From 691430f9197a510fe614dfec737a2ccc67bd1906 Mon Sep 17 00:00:00 2001 From: Nikolaus Schuetz Date: Mon, 29 Jun 2026 12:13:53 -0700 Subject: [PATCH] Add four `job.workflow_*` context properties (fix #647) 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) --- expr_sema.go | 6 +++++- expr_sema_test.go | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/expr_sema.go b/expr_sema.go index b7bb4e8ed..8f27bb186 100644 --- a/expr_sema.go +++ b/expr_sema.go @@ -322,7 +322,11 @@ var BuiltinGlobalVariableTypes = map[string]ExprType{ "ports": NewMapObjectType(StringType{}), }), ), - "status": StringType{}, + "status": StringType{}, + "workflow_file_path": StringType{}, + "workflow_ref": StringType{}, + "workflow_repository": StringType{}, + "workflow_sha": StringType{}, }), // https://docs.github.com/en/actions/learn-github-actions/contexts#steps-context "steps": NewEmptyStrictObjectType(), // This value will be updated contextually diff --git a/expr_sema_test.go b/expr_sema_test.go index 959ef1682..4a57c3f30 100644 --- a/expr_sema_test.go +++ b/expr_sema_test.go @@ -77,6 +77,11 @@ func TestExprSemanticsCheckOK(t *testing.T) { input: "job.container.network", expected: StringType{}, }, + { + what: "job workflow identity context property", + input: "job.workflow_ref", + expected: StringType{}, + }, { what: "object property dereference for any type", input: "github.event.labels",