mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-18 00:40:08 +00:00
Split repo trusted setting (#4025)
This commit is contained in:
@@ -207,7 +207,11 @@ func execWithAxis(ctx context.Context, c *cli.Command, file, repoPath string, ax
|
||||
|
||||
// lint the yaml file
|
||||
err = linter.New(
|
||||
linter.WithTrusted(true),
|
||||
linter.WithTrusted(linter.TrustedConfiguration{
|
||||
Security: c.Bool("repo-trusted-security"),
|
||||
Network: c.Bool("repo-trusted-network"),
|
||||
Volumes: c.Bool("repo-trusted-volumes"),
|
||||
}),
|
||||
linter.PrivilegedPlugins(privilegedPlugins),
|
||||
linter.WithTrustedClonePlugins(constant.TrustedClonePlugins),
|
||||
).Lint([]*linter.WorkflowConfig{{
|
||||
|
@@ -185,9 +185,19 @@ var flags = []cli.Flag{
|
||||
Usage: "Set the metadata environment variable \"CI_REPO_PRIVATE\".",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Sources: cli.EnvVars("CI_REPO_TRUSTED"),
|
||||
Name: "repo-trusted",
|
||||
Usage: "Set the metadata environment variable \"CI_REPO_TRUSTED\".",
|
||||
Sources: cli.EnvVars("CI_REPO_TRUSTED_NETWORK"),
|
||||
Name: "repo-trusted-network",
|
||||
Usage: "Set the metadata environment variable \"CI_REPO_TRUSTED_NETWORK\".",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Sources: cli.EnvVars("CI_REPO_TRUSTED_VOLUMES"),
|
||||
Name: "repo-trusted-volumes",
|
||||
Usage: "Set the metadata environment variable \"CI_REPO_TRUSTED_VOLUMES\".",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Sources: cli.EnvVars("CI_REPO_TRUSTED_SECURITY"),
|
||||
Name: "repo-trusted-security",
|
||||
Usage: "Set the metadata environment variable \"CI_REPO_TRUSTED_SECURITY\".",
|
||||
},
|
||||
&cli.IntFlag{
|
||||
Sources: cli.EnvVars("CI_PIPELINE_NUMBER"),
|
||||
|
@@ -83,7 +83,9 @@ func metadataFromContext(_ context.Context, c *cli.Command, axis matrix.Axis, w
|
||||
metadataFileAndOverrideOrDefault(c, "repo-clone-url", func(s string) { m.Repo.CloneURL = s }, c.String)
|
||||
metadataFileAndOverrideOrDefault(c, "repo-clone-ssh-url", func(s string) { m.Repo.CloneSSHURL = s }, c.String)
|
||||
metadataFileAndOverrideOrDefault(c, "repo-private", func(b bool) { m.Repo.Private = b }, c.Bool)
|
||||
metadataFileAndOverrideOrDefault(c, "repo-trusted", func(b bool) { m.Repo.Trusted = b }, c.Bool)
|
||||
metadataFileAndOverrideOrDefault(c, "repo-trusted-network", func(b bool) { m.Repo.Trusted.Network = b }, c.Bool)
|
||||
metadataFileAndOverrideOrDefault(c, "repo-trusted-security", func(b bool) { m.Repo.Trusted.Security = b }, c.Bool)
|
||||
metadataFileAndOverrideOrDefault(c, "repo-trusted-volumes", func(b bool) { m.Repo.Trusted.Volumes = b }, c.Bool)
|
||||
|
||||
// Current Pipeline
|
||||
metadataFileAndOverrideOrDefault(c, "pipeline-number", func(i int64) { m.Curr.Number = i }, c.Int)
|
||||
|
Reference in New Issue
Block a user