From 763dff2018de396e4e1ee7f7018d497575998cdf Mon Sep 17 00:00:00 2001 From: Salman Muin Kayser Chishti Date: Tue, 14 Apr 2026 10:55:58 +0000 Subject: [PATCH] fix: address review nits - update doc comments, test names, and description wording - Update getJobContext doc comment to include workflow identity fields - Rename test to reflect all returned fields, not just status/check_run_id - Rename validate test to 'job.workflow_* fields' covering all 4 properties - Clarify workflow_ref description: 'ref path to' instead of 'ref of' --- languageservice/src/context-providers/descriptions.json | 2 +- languageservice/src/context-providers/job.test.ts | 2 +- languageservice/src/context-providers/job.ts | 2 +- languageservice/src/validate.expressions.test.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/languageservice/src/context-providers/descriptions.json b/languageservice/src/context-providers/descriptions.json index 80364ab..c8326f6 100644 --- a/languageservice/src/context-providers/descriptions.json +++ b/languageservice/src/context-providers/descriptions.json @@ -223,7 +223,7 @@ "description": "The path of the workflow file that contains the job. For example, `.github/workflows/my-workflow.yml`." }, "workflow_ref": { - "description": "The ref of the workflow file that contains the job. For example, `octocat/hello-world/.github/workflows/my-workflow.yml@refs/heads/my_branch`." + "description": "The ref path to the workflow file that contains the job. For example, `octocat/hello-world/.github/workflows/my-workflow.yml@refs/heads/my_branch`." }, "workflow_repository": { "description": "The owner and repository name of the workflow file that contains the job. For example, `octocat/Hello-World`." diff --git a/languageservice/src/context-providers/job.test.ts b/languageservice/src/context-providers/job.test.ts index 4a768f5..0e55844 100644 --- a/languageservice/src/context-providers/job.test.ts +++ b/languageservice/src/context-providers/job.test.ts @@ -18,7 +18,7 @@ describe("job context", () => { expect(context.pairs().length).toBe(0); }); - it("returns status and check_run_id when job has no container or services", () => { + it("returns status, check_run_id, and workflow fields when job has no container or services", () => { const workflowContext = {job: {}} as WorkflowContext; const context = getJobContext(workflowContext); diff --git a/languageservice/src/context-providers/job.ts b/languageservice/src/context-providers/job.ts index 0a7bbc2..2e066e0 100644 --- a/languageservice/src/context-providers/job.ts +++ b/languageservice/src/context-providers/job.ts @@ -5,7 +5,7 @@ import {WorkflowContext} from "../context/workflow-context.js"; import {getDescription} from "./descriptions.js"; /** - * Returns the job context with container, services, status, and check_run_id. + * Returns the job context with container, services, status, check_run_id, and workflow identity fields. */ export function getJobContext(workflowContext: WorkflowContext): DescriptionDictionary { // https://docs.github.com/en/actions/learn-github-actions/contexts#job-context diff --git a/languageservice/src/validate.expressions.test.ts b/languageservice/src/validate.expressions.test.ts index 903d65c..850251f 100644 --- a/languageservice/src/validate.expressions.test.ts +++ b/languageservice/src/validate.expressions.test.ts @@ -432,7 +432,7 @@ jobs: expect(result).toEqual([]); }); - it("job.workflow_ref", async () => { + it("job.workflow_* fields", async () => { const input = ` on: push