Repository navigation
feat: support parallel steps (background, wait, wait-all, cancel, parallel) - #12
Merged
jdx merged 12 commits intoOct 5, 2026
Merged
Conversation
…arallel)
GitHub released parallel steps on 2026-06-25, introducing five new step keys:
`background`, `wait`, `wait-all`, `cancel`, and `parallel`. Until now actionlint
rejected workflows using them ("unexpected key ..." / "step must run ..."). This
adds parsing and AST support for them:
- `background: true` is parsed as a new optional `*Bool` field on a step (run or
action step), mirroring `continue-on-error`.
- `wait`/`wait-all`, `cancel`, and `parallel` are modeled as new step execution
kinds (`ExecWait`, `ExecCancel`, `ExecParallel`) so they no longer trip the
"step must run ... run/uses" check. `wait` and `cancel` accept a single ID or a
list of IDs; `parallel` parses its grouped steps recursively, and those nested
steps are visited by every rule so they keep getting linted.
Expression/context checking for the new fields is intentionally deferred: the
generated context-availability table does not describe them yet, so checking now
would produce false positives. `name`/`if` on the new step kinds are still
checked as before.
Closes #693
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The GitHub workflow-syntax docs specify that `cancel` "targets a single background step by its `id`" (unlike `wait`, which is a string or an array). Parse `cancel` as a single string instead of a string-or-list so that `cancel: [a, b]` is correctly reported as a type error, and fix the fixture accordingly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Address review feedback on the parallel-steps PR: - `wait-all` waits for all background steps and takes no arguments, so report an error when a value is given (e.g. `wait-all: foo`). - `wait` and `wait-all` in the same step are contradictory (one targets specific background steps, the other waits for all); flag it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
`wait` and `cancel` steps refer to the IDs of background steps, much like `needs:` refers to job IDs. This adds a rule that flags a `wait`/`cancel` target that doesn't match the ID of a preceding `background: true` step, catching typos such as `cancel: typo`. A single in-order walk (recursing into `parallel:` groups) validates existence, that the target is a background step, and that it precedes the reference. `wait-all` and expression-valued IDs are skipped. Addresses review feedback on the parallel-steps PR. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The visitor already recurses into 'parallel:' groups, visiting every step in order, so the rule can accumulate background step IDs in VisitStep (resetting per job in VisitJobPre) instead of re-walking the step tree itself. This matches the RuleID pattern and removes the manual recursion. No behaviour change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A `parallel` group is shorthand for backgrounding each of its steps with an implicit wait at the end, so a `parallel` step cannot itself appear inside another `parallel` group. Flag it in the parallel-steps rule. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds an ok fixture covering the defensive paths: a step whose `background` is an expression is treated as a possible background step (so a `wait`/`cancel` to it isn't flagged), and an expression-valued `wait`/`cancel` reference is skipped because it can't be resolved statically. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
GitHub's workflow parser (actions/languageservices) only allows `run` and `uses` steps inside a `parallel` group; `background`, `wait`, `wait-all`, `cancel`, and nested `parallel` steps are rejected at parse time. Extend the parallel-steps rule to flag each of them so actionlint matches the runtime's validation instead of only catching nested `parallel`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…scade A `wait`/`cancel` step inside a `parallel` group is already reported as not allowed there, but its target was still validated, producing a second, redundant "unknown reference" error for the same step. Track the steps that are direct children of a `parallel` group and skip the reference check for them, so each such step yields a single, root-cause error — matching GitHub's parser, which reports only the structural violation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
# Conflicts: # testdata/err/unexpected_keys.out # testdata/examples/unexpected_keys.out
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 56 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
⛔ Files ignored due to path filters (10)
📒 Files selected for processing (15)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4d7d16d. Configure here.
This was referenced Oct 5, 2026
jdx
added a commit
that referenced
this pull request
Oct 5, 2026
…#31) Follow-up to #12, addressing the two unresolved Cursor Bugbot threads. ## Changes - **`wait-all` accepts `null` or a boolean.** The SchemaStore `github-workflow` schema types it as `boolean | null` ("takes no arguments"), so `wait-all: true` (and `false`) was wrongly a syntax error. Strings, sequences and mappings are still rejected, with a clearer message. - **Expressions in `background`, `wait` and `cancel` are now checked.** `background` is type-checked as a bool (like `continue-on-error`); `wait` IDs and the `cancel` ID are checked as strings. The context availability table has no entry for these new keys, so they reuse the `jobs.<job_id>.steps.continue-on-error` availability. - **Wording:** a null/non-sequence `parallel:` is now reported as `"parallel" section must be sequence node...` and `element of "parallel" section...` instead of `steps section`. - Tests: `testdata/ok/parallel_steps_exprs.yaml`, `testdata/err/parallel_steps_exprs.{yaml,out}`; updated existing parallel outputs. - Includes the one-line `rule_runner_label_test.go` compile fix from #27 (identical, so no conflict). ## Not implemented (semantics not clearly documented / false-positive risk) - `if:` on wait/wait-all/cancel: no official source found stating it is unsupported (workflow-syntax docs not retrievable, schema is silent). - More than 10 concurrent background steps: documented only in the schema description, and "concurrent" depends on runtime completion; a static count would produce false positives. - Outputs of a background step referenced before `wait`/`wait-all`: documented only in the schema description, and needs flow-sensitive tracking in the expression checker. Worth a separate change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Changes are confined to workflow parsing, expression linting for new parallel-step fields, and test fixtures—no auth, runtime, or data-path impact. > > **Overview** > Aligns parallel-step linting with the official workflow schema and closes gaps in expression checking for **background**, **wait**, **cancel**, and nested **parallel** steps. > > **`wait-all`** now allows an empty value or a boolean (`wait-all:` / `wait-all: true|false`) instead of treating any non-null value as invalid; strings, sequences, and mappings still fail with a clearer syntax message. > > **Expression rule** validates `${{ }}` on `background` (must be bool), `wait` targets, and `cancel` IDs (strings), using the same context availability as `continue-on-error` until the availability table lists these keys. > > **Parser diagnostics** pass the section name into `parseStep`/`parseSteps` so malformed nested steps under `parallel:` report `"parallel" section` rather than `"steps" section`. > > Tests add `parallel_steps_exprs` ok/error fixtures and refresh expected messages; `rule_runner_label_test` updates `String` construction for a new field. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1e22008. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
jdx
added a commit
that referenced
this pull request
Oct 5, 2026
🤖 I have created a release *beep* *boop* --- ## [1.8.0](v1.7.12...v1.8.0) (2026-10-05) ### Features * `workflow_dispatch` allows 25 inputs ([38dfd8e](38dfd8e)) * add config-secrets option to allow-list secrets ([#16](#16)) ([b00331b](b00331b)) * add inline ignore comments ([#23](#23)) ([e4dee7a](e4dee7a)) * add opt-in check for local actions used before checkout ([#29](#29)) ([34f436a](34f436a)) * add opt-in check for workflow_run workflow names ([#30](#30)) ([a9d60af](a9d60af)) * add opt-in require-expression-wrapping and check-falsy-ternary ([#25](#25)) ([075f8b8](075f8b8)) * add opt-in require-permissions rule ([#32](#32)) ([736d914](736d914)) * add opt-in require-shell and max-run-lines checks ([#26](#26)) ([7d1db16](7d1db16)) * add opt-in timeout-check rule for job timeout-minutes ([#24](#24)) ([bb70379](bb70379)) * add self-hosted-runner.strict-labels config option ([#21](#21)) ([a9a4ce0](a9a4ce0)) * add support for 'code-quality' permission ([d147267](d147267)) * detect caller/callee permission mismatch in reusable workflow calls ([#13](#13)) ([6699dde](6699dde)) * detect more attacker-controlled script injection inputs ([#22](#22)) ([c962011](c962011)) * import upstream actionlint PRs and fix upstream issues [#747](https://github.com/jdx/jactionlint/issues/747)-[#750](https://github.com/jdx/jactionlint/issues/750) ([#11](#11)) ([143400e](143400e)) * load user-global config from XDG_CONFIG_HOME ([#15](#15)) ([c72f98b](c72f98b)) * opt-in require-commit-hash lint (rhysd/actionlint[#436](https://github.com/jdx/jactionlint/issues/436)) ([#19](#19)) ([acbebb1](acbebb1)) * opt-in required-actions rule (upstream [#474](https://github.com/jdx/jactionlint/issues/474)) ([#17](#17)) ([717783d](717783d)) * **shellcheck:** map errors to source lines in literal blocks ([#18](#18)) ([5d3c39a](5d3c39a)) * support parallel steps (background, wait, wait-all, cancel, parallel) ([#12](#12)) ([35ddf4a](35ddf4a)) * support windows-11-vs2026-arm runner ([5231ce6](5231ce6)) * Support YAML anchors and aliases in parser ([8ed4c46](8ed4c46)) * workflow_dispatch allows 25 inputs ([673e4d3](673e4d3)) ### Bug Fixes * accept boolean wait-all and type-check parallel step expressions ([#31](#31)) ([cddd34b](cddd34b)) * add artifact-metadata ([ff3994b](ff3994b)) * add artifact-metadata ([c2e42cf](c2e42cf)) * add documented job workflow context properties ([f6542f4](f6542f4)) * Add undocumented github.repository_visibility option ([c391460](c391460)) * Add undocumented github.repository_visibility option ([a533631](a533631)) * add windows-11-arm to runner os ([180ef9e](180ef9e)) * check matrix exclude values against matrix rows only ([#20](#20)) ([65dfbe2](65dfbe2)) * repair main's runner label test after concurrent merges ([#27](#27)) ([ada1320](ada1320)) * report correct position for expression errors in literal blocks ([#28](#28)) ([2df981e](2df981e)) * Validating permission scopes: id-token and models ([9510b01](9510b01)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Version and documentation-only release PR from Release Please; no runtime code changes in the diff, though upgrading to 1.8.0 may surface new linter findings for consumers. > > **Overview** > **Release 1.8.0** — bumps the project version from `1.7.12` to `1.8.0` in `.release-please-manifest.json`, the pre-commit Docker hook (`ghcr.io/jdx/jactionlint:1.8.0`), `docs/usage.md` examples, and the playground version badge/link. > > `CHANGELOG.md` gains a new **1.8.0** section (features and fixes from the release train) and older release headings are normalized from `#` to `##` for consistent markdown structure. > > The substantive product changes in this release (new opt-in lint rules, parallel steps, inline ignores, permission/security checks, etc.) are documented in the changelog; this PR does not modify linter source in the diff shown. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 4632529. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Imports rhysd/actionlint#694 (parallel step syntax) and #695 (
parallel-stepsrule), plus a malformed-input test and regenerateddocs/checks.md. Closes the fork-side equivalent of rhysd/actionlint#693.ifon wait/cancel steps, the 10 concurrent background step limit, outputs referenced before await.mainwhen feat: import upstream actionlint PRs and fix upstream issues #747-#750 #11 merges.🤖 Generated with Claude Code
Note
Medium Risk
Substantial parser and AST changes for step kinds; incorrect parallel-step validation could cause false positives/negatives in workflow linting, but scope is limited to the new syntax and rule.
Overview
Adds GitHub Actions parallel step syntax to actionlint:
backgroundon run/uses steps, dedicated step typeswait,wait-all,cancel, andparallel, with AST types (ExecWait,ExecCancel,ExecParallel) and parser support including mutual exclusion ofwaitvswait-alland syntax validation for each step kind.A new
parallel-stepsrule checks thatwait/canceltargets refer to earlier steps withbackground: true(case-insensitive IDs; expression IDs skipped), and thatparallelgroups only containrun/usessteps—no nestedparallel,background,wait, orcancel. Nested parallel steps are still linted viaVisitSteprecursion inpass.go.Docs (
checks.md), SARIF rule metadata, and golden test fixtures are updated; expected-key messages for run/action steps now includebackground.Reviewed by Cursor Bugbot for commit 4d7d16d. Bugbot is set up for automated code reviews on this repo. Configure here.