-
Notifications
You must be signed in to change notification settings - Fork 476
feat: shellcheck disabled by default, opt-in via --shellcheck/--validate, parallel execution #49880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
bd3b749
b6878dc
6600aef
09a6d65
dc8c41e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -422,7 +422,7 @@ type compileCmdOptions struct { | |
| grype bool | ||
| grant bool | ||
| yamllint bool | ||
| noShellcheck bool | ||
| shellcheck bool | ||
| jsonOutput bool | ||
| showAllErrors bool | ||
| fix bool | ||
|
|
@@ -465,7 +465,7 @@ func getCompileCmdOptions(cmd *cobra.Command) compileCmdOptions { | |
| grype, _ := cmd.Flags().GetBool("grype") | ||
| grant, _ := cmd.Flags().GetBool("grant") | ||
| yamllint, _ := cmd.Flags().GetBool("yamllint") | ||
| noShellcheck, _ := cmd.Flags().GetBool("no-shellcheck") | ||
| shellcheck, _ := cmd.Flags().GetBool("shellcheck") | ||
| jsonOutput, _ := cmd.Flags().GetBool("json") | ||
| showAllErrors, _ := cmd.Flags().GetBool("show-all") | ||
| fix, _ := cmd.Flags().GetBool("fix") | ||
|
|
@@ -485,7 +485,7 @@ func getCompileCmdOptions(cmd *cobra.Command) compileCmdOptions { | |
| dir: dir, workflowsDir: workflowsDir, logicalRepo: logicalRepo, scheduleSeed: scheduleSeed, priorManifestFile: priorManifestFile, | ||
| validate: validate, watch: watch, noEmit: noEmit, purge: purge, strict: strict, trial: trial, dependabot: dependabot, | ||
| forceOverwrite: forceOverwrite, refreshStopTime: refreshStopTime, forceRefreshActionPins: forceRefreshActionPins, allowActionRefs: allowActionRefs, | ||
| zizmor: zizmor, poutine: poutine, actionlint: actionlint, runnerGuard: runnerGuard, syft: syft, grype: grype, grant: grant, yamllint: yamllint, noShellcheck: noShellcheck, | ||
| zizmor: zizmor, poutine: poutine, actionlint: actionlint, runnerGuard: runnerGuard, syft: syft, grype: grype, grant: grant, yamllint: yamllint, shellcheck: shellcheck, | ||
| jsonOutput: jsonOutput, showAllErrors: showAllErrors, fix: fix, stats: stats, failFast: failFast, noCheckUpdate: noCheckUpdate, | ||
| staged: staged, approve: approve, validateImages: validateImages, ghes: ghes, verbose: verbose, useSamples: useSamples, | ||
| } | ||
|
|
@@ -518,7 +518,7 @@ func (o *compileCmdOptions) toCompileConfig(args []string) cli.CompileConfig { | |
| NoEmit: o.noEmit, Purge: o.purge, TrialMode: o.trial, TrialLogicalRepoSlug: o.logicalRepo, Strict: o.strict, | ||
| Dependabot: o.dependabot, ForceOverwrite: o.forceOverwrite, RefreshStopTime: o.refreshStopTime, ForceRefreshActionPins: o.forceRefreshActionPins, | ||
| AllowActionRefs: o.allowActionRefs, Zizmor: o.zizmor, Poutine: o.poutine, Actionlint: o.actionlint, RunnerGuard: o.runnerGuard, | ||
| Syft: o.syft, Grype: o.grype, Grant: o.grant, Yamllint: o.yamllint, NoShellcheck: o.noShellcheck, JSONOutput: o.jsonOutput, ShowAllErrors: o.showAllErrors, | ||
| Syft: o.syft, Grype: o.grype, Grant: o.grant, Yamllint: o.yamllint, Shellcheck: o.shellcheck, JSONOutput: o.jsonOutput, ShowAllErrors: o.showAllErrors, | ||
| Stats: o.stats, FailFast: o.failFast, ScheduleSeed: o.scheduleSeed, Staged: o.staged, Approve: o.approve, | ||
| ValidateImages: o.validateImages, PriorManifestFile: o.priorManifestFile, GHESCompat: o.ghes, UseSamples: o.useSamples, | ||
| } | ||
|
|
@@ -747,7 +747,7 @@ func configureCompileBuildFlags() { | |
| compileCmd.Flags().String("action-tag", "", "Pin compiled workflows to a specific version of gh-aw actions. Accepts a full commit SHA or a version tag (e.g. v1, v1.2.3). Sets --action-mode to 'release' unless --action-mode action is also specified. Cannot be combined with --gh-aw-ref; use --gh-aw-ref when you want to resolve a branch or tag name to its current SHA") | ||
| compileCmd.Flags().String("actions-repo", "", "Override the external actions repository used in action mode (default: github/gh-aw-actions)") | ||
| compileCmd.Flags().String("gh-aw-ref", "", "Pin compiled workflows to a specific branch, tag, or commit SHA of github/gh-aw (e.g. main, my-feature, abc123). Branch and tag names are resolved to their full commit SHA at compile time so the baked-in ref is immutable. Equivalent to --action-mode release --action-tag <resolved-sha>. Cannot be combined with --action-tag or --action-mode. Use this to E2E-test workflows against a specific gh-aw revision") | ||
| compileCmd.Flags().Bool("validate", false, "Enable GitHub Actions workflow schema validation, container image validation, and action SHA validation") | ||
| compileCmd.Flags().Bool("validate", false, "Enable GitHub Actions workflow schema validation, container image validation, action SHA validation, and run step shell linting (shellcheck)") | ||
| compileCmd.Flags().BoolP("watch", "w", false, "Watch for changes to workflow files and recompile automatically") | ||
| compileCmd.Flags().StringP("dir", "d", "", "Workflow directory (default: $GH_AW_WORKFLOWS_DIR or .github/workflows)") | ||
| compileCmd.Flags().String("workflows-dir", "", "Deprecated: use --dir instead") | ||
|
|
@@ -775,7 +775,9 @@ func configureCompileToolFlags() { | |
| compileCmd.Flags().Bool("grype", false, "Run grype vulnerability scanner on container images referenced in compiled .lock.yml files (uses Docker image "+cli.GrypeImage+")") | ||
| compileCmd.Flags().Bool("grant", false, "Run grant license scanner on container images referenced in compiled .lock.yml files (uses Docker image "+cli.GrantImage+")") | ||
| compileCmd.Flags().Bool("yamllint", false, "Run yamllint YAML linter on generated .lock.yml files (uses Docker image "+cli.YamllintImage+")") | ||
| compileCmd.Flags().Bool("no-shellcheck", false, "Disable shellcheck linting of run step scripts (shellcheck runs by default when available)") | ||
| compileCmd.Flags().Bool("shellcheck", false, "Run shellcheck linting of run step scripts (also enabled by --validate)") | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 09a6d65. Updated |
||
| compileCmd.Flags().Bool("no-shellcheck", false, "Deprecated: shellcheck is now opt-in via --shellcheck; this flag is a no-op and will be removed in a future release") | ||
| _ = compileCmd.Flags().MarkDeprecated("no-shellcheck", "shellcheck is now opt-in; use --shellcheck to enable it. This flag has no effect and will be removed in a future release") | ||
| compileCmd.Flags().Bool("fix", false, "Apply automatic codemod fixes to workflows before compiling") | ||
| compileCmd.Flags().BoolP("json", "j", false, "Output results in JSON format") | ||
| compileCmd.Flags().Bool("show-all", false, "Display all compilation errors instead of only the highest-priority subset (default: top 5)") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 09a6d65. Added a major changeset (
.changeset/shellcheck-opt-in-default.md) documenting the breaking behavior change and migration guide. Also retained--no-shellcheckas a deprecated no-op so existing scripts continue to work — it prints a deprecation warning when used.