Skip to content

Commit 763dff2

Browse files
authored
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'
1 parent 0c9d817 commit 763dff2

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

languageservice/src/context-providers/descriptions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@
223223
"description": "The path of the workflow file that contains the job. For example, `.github/workflows/my-workflow.yml`."
224224
},
225225
"workflow_ref": {
226-
"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`."
226+
"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`."
227227
},
228228
"workflow_repository": {
229229
"description": "The owner and repository name of the workflow file that contains the job. For example, `octocat/Hello-World`."

languageservice/src/context-providers/job.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe("job context", () => {
1818
expect(context.pairs().length).toBe(0);
1919
});
2020

21-
it("returns status and check_run_id when job has no container or services", () => {
21+
it("returns status, check_run_id, and workflow fields when job has no container or services", () => {
2222
const workflowContext = {job: {}} as WorkflowContext;
2323
const context = getJobContext(workflowContext);
2424

languageservice/src/context-providers/job.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {WorkflowContext} from "../context/workflow-context.js";
55
import {getDescription} from "./descriptions.js";
66

77
/**
8-
* Returns the job context with container, services, status, and check_run_id.
8+
* Returns the job context with container, services, status, check_run_id, and workflow identity fields.
99
*/
1010
export function getJobContext(workflowContext: WorkflowContext): DescriptionDictionary {
1111
// https://docs.github.com/en/actions/learn-github-actions/contexts#job-context

languageservice/src/validate.expressions.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ jobs:
432432
expect(result).toEqual([]);
433433
});
434434

435-
it("job.workflow_ref", async () => {
435+
it("job.workflow_* fields", async () => {
436436
const input = `
437437
on: push
438438

0 commit comments

Comments
 (0)