Add four job.workflow_* context properties (fix #647)#696
Open
nikolauspschuetz wants to merge 1 commit into
Open
Add four job.workflow_* context properties (fix #647)#696nikolauspschuetz wants to merge 1 commit into
job.workflow_* context properties (fix #647)#696nikolauspschuetz wants to merge 1 commit into
Conversation
The GitHub Actions runner added four new workflow-identity properties to
the `job` context: `job.workflow_ref`, `job.workflow_sha`,
`job.workflow_repository`, and `job.workflow_file_path`. They are now
documented in the "job context" section of the GitHub Actions contexts
reference.
Since `job` is modeled as a strict object type, referencing any of these
properties (e.g. `${{ job.workflow_ref }}`) was wrongly reported as
`property "workflow_ref" is not defined in object type ...`. Add the four
string-typed properties so valid workflows are no longer flagged.
Assisted-by: Claude Code (Anthropic, Opus 4.x)
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.
Summary
Fixes #647.
The GitHub Actions runner added four new workflow-identity properties to the
jobcontext (actions/runner#4335), now documented in the job context reference:job.workflow_refjob.workflow_shajob.workflow_repositoryowner/repoof the workflow filejob.workflow_file_path.github/workflows/file.ymlBecause
jobis modeled as a strict object type, referencing any of these (e.g.${{ job.workflow_ref }}) was wrongly reported as:This PR adds the four string-typed properties so valid workflows are no longer flagged. This follows the same pattern as the recently-added
job.check_run_idproperty (#576).Testing
job.workflow_reftoTestExprSemanticsCheckOKinexpr_sema_test.go. It fails on the old code (property reported as undefined) and passes with the fix.go test ./...— all packages pass.go build ./...,go vet ./...,gofmt -l— all clean.AI assistance
This change was prepared with the help of Claude Code (Anthropic, Opus 4.x). The diff was reviewed and verified locally by the author (build/test/vet/fmt all green; regression test confirmed failing without the fix). The commit carries an
Assisted-by:trailer.