Add flag to only access public repositories on GitHub (#3566)

This commit is contained in:
Aumetra Weisman
2024-03-29 14:36:48 +01:00
committed by GitHub
parent e1b574a4bc
commit 20b84a1aee
4 changed files with 24 additions and 1 deletions

View File

@@ -340,6 +340,12 @@ var flags = append([]cli.Flag{
Usage: "github pull requests use merge ref",
Value: true,
},
&cli.BoolFlag{
EnvVars: []string{"WOODPECKER_GITHUB_PUBLIC_ONLY"},
Name: "github-public-only",
Usage: "github tokens should only get access to public repos",
Value: false,
},
&cli.BoolFlag{
EnvVars: []string{"WOODPECKER_GITHUB_SKIP_VERIFY"},
Name: "github-skip-verify",

View File

@@ -200,6 +200,7 @@ func setupGitHub(c *cli.Context) (forge.Forge, error) {
Secret: c.String("github-secret"),
SkipVerify: c.Bool("github-skip-verify"),
MergeRef: c.Bool("github-merge-ref"),
OnlyPublic: c.Bool("github-public-only"),
}
log.Trace().Msgf("forge (github) opts: %#v", opts)
return github.New(opts)