Add language service support for action.yml files (#275)

- Add validation, completion, hover, and document links for action.yml files
- Implement document type detection to route action.yml to action-specific handlers
- Add expression context for composite actions (inputs, steps, github, runner, etc.)
- Add schema validation for required fields, branding, and composite step requirements
- Support JavaScript (node20/node24), Docker, and composite action types
- Validate action references in composite action uses steps
- Add JSDoc comments to parser and template functions
- Refactor hover to use hoverToken consistently
- Fix lint errors and add return type annotations
This commit is contained in:
eric sciple
2026-01-02 10:38:52 -06:00
committed by GitHub
parent 3734de18ee
commit d2ffb50a92
45 changed files with 3700 additions and 477 deletions
@@ -129,4 +129,31 @@ jobs:
}
]);
});
it("links for actions in composite action", async () => {
const input = `name: My Composite Action
description: A composite action with nested actions
runs:
using: composite
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: echo "Hello"
shell: bash`;
const result = await documentLinks(createDocument("action.yml", input), undefined);
expect(result).toHaveLength(2);
expect(result[0].target).toBe("https://www.github.com/actions/checkout/tree/v4/");
expect(result[0].tooltip).toBe("Open action on GitHub");
expect(result[1].target).toBe("https://www.github.com/actions/setup-node/tree/v4/");
});
it("no links for non-composite action", async () => {
const input = `name: My Node Action
description: A node action
runs:
using: node20
main: index.js`;
const result = await documentLinks(createDocument("action.yml", input), undefined);
expect(result).toHaveLength(0);
});
});