mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-22 02:19:25 +00:00
Add flag to only access public repositories on GitHub (#3566)
This commit is contained in:
@@ -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",
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user