Repository navigation
Update snapshot-if context and functions - #4443
Merged
ericsciple merged 1 commit intoMay 21, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the workflow expression schema and converter to recognize additional contexts and functions in snapshot if conditionals.
Changes:
- Expanded allowed named-values and functions for snapshot
ifexpressions in the workflow schema JSON. - Updated
WorkflowTemplateConverterto include additional named values and to enable snapshot condition functions (previouslynull).
Show a summary per file
| File | Description |
|---|---|
| src/Sdk/WorkflowParser/workflow-v1.0.json | Extends snapshot if schema context list with additional named values and functions. |
| src/Sdk/WorkflowParser/Conversion/WorkflowTemplateConverter.cs | Adds named values and defines snapshot condition functions for expression parsing/validation. |
| src/Sdk/DTPipelines/workflow-v1.0.json | Mirrors the schema context expansion in the DTPipelines copy. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 2
ericsciple
approved these changes
May 21, 2026
jdx
added a commit
to jdx/jactionlint
that referenced
this pull request
Oct 13, 2026
…e docs do not list (#170) ## What The `correctness` profile reported keys, values and contexts that GitHub accepts. Each of them is allowed by the workflow schema of the runner (`src/Sdk/WorkflowParser/workflow-v1.0.json`) or of the language service (`actions/languageservices`, `workflow-parser/src/workflow-v1.0.json`), but the documentation that the generators read does not list them yet. I checked every item against the schema (and the PR or commit that added it) before changing anything. | Item | Source | | --- | --- | | top-level `description:` | `workflow-root` of both schemas | | `cancel-timeout-minutes` on a job (`jobs.<id>.timeout-minutes` contexts) | `job-factory` of both schemas | | `types` of `image_version` (`created`, `ready`, `deleted`) | `image-version-mapping` of both schemas | | `stacked` for `pull_request` and `pull_request_target` | languageservices#384 and its schema (the runner schema does not have it yet) | | `drives` permission scope (`read`, `write`, `none`) | languageservices#380 | | `github.artifacts`, `github.artifacts_list` | github/docs `contexts.md`, behind the `actions-artifacts-file` flag | | empty string in the `options` of a `choice` input | languageservices 2934e369 (vscode-github-actions#395). The runner schema still says non-empty; the dispatch form is the server's, so I followed the language service | | `steps`, `job`, `runner`, `env`, `always/cancelled/failure/success`, `hashFiles` in `snapshot.if` | actions/runner#4443, `snapshot-if` of the runner schema | | a 64 digit commit hash is a pinned `uses:` | actions/runner#4347 | Also: - `excessive-permissions` skips a level that the scope does not have (`models: write`). It printed `lets the job , and ...` with an empty description; `invalid-permissions` already reports the level. `drives` has a description now. `undocumented-permissions` has no scope table, so it needed no entry. - `snapshot.if` is now checked after the steps of the job (like `outputs`), so `steps.<id>` is typed and a missing step is still reported. - The webhook generator has an override table, `scripts/generate-webhook-events/overrides.go`, with the source of every entry. It is applied in `run()` after parsing the docs, so `go generate` keeps `stacked` and the `image_version` types. `all_webhooks.go` has the same content, which I checked by regenerating from the live docs into a scratch file (the only difference was `merge_group: destroyed`, which the docs dropped and which is the other data PR's business and the next PR's). The `snapshot.if` fallback of the availability generator was extended the same way; `availability.go` equals what the generator prints from the live docs. - `docs/actionlint.md` lists these as places where the checks follow a newer schema than actionlint 1.7. The `.out` files of the fixtures that came from actionlint were updated: the key lists in `unexpected key` messages, and the lines that expected an error for `''` in `options` and for `env`/`runner` in `snapshot.if`. Part of #167 (the first "schema drift" checkbox). ## Not done / skipped - `snapshot.tags`, job-level `success(...)` arguments and the relaxed-parser keys of the runner schema (item 26 of the research) are not documented; left for later. - `repository-projects` no longer documented: low priority, it goes with the false-negative PR if at all. ## Tests - `testdata/ok/schema_drift.yaml`: every item above, must stay clean in the correctness profile. - `testdata/err/schema_drift_invalid.yaml`: what must still be reported next to them (an unknown type or level, a duplicated empty option, `secrets` in `cancel-timeout-minutes`, a missing step in `snapshot.if`). - `schema_drift_test.go`: types, `snapshot.if` availability, `snapshot.if` against the steps of the job, excessive-permissions for `models: write` and `drives: write`, and that every scope with a `write` level has a description. - Unit tests for the generator override, the 64 digit pin (`TestParseUses`, `TestRequireCommitHashOptIn`). - `go build ./...`, `go vet ./...`, `gofmt -l`, `go test ./...` (the root package takes about 200 s on this loaded machine) and `go run ./scripts/generate-rules-doc -check` pass. I did not run `go test -race` or `hk check --all` (the machine was at load 380 from the parallel agents), and `staticcheck` in this environment fails on export data of the toolchain. I did not run a corpus: nothing here adds a finding. Every change makes the profile accept more. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 5.5 <[email protected]>
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.
Reflects changes added to the workflow parser from PR https://github.com/github/actions-workflow-parser/pull/607
Related issue: https://github.com/github/hosted-compute-ims/issues/1639