Uh oh!
There was an error while loading. Please reload this page.
feat: Show latest version of action in hover tooltip - #584
Conversation
- Add quick fix when new version avaliable
There was a problem hiding this comment.
Pull request overview
Adds editor UX for GitHub Actions uses: references by showing the latest available version on hover and offering a Quick Fix to update outdated refs.
Changes:
- Introduces a hover provider that looks up and displays the latest action version from GitHub.
- Introduces a Quick Fix code action to update
@refto the latest tag (and optionally latest major tag). - Registers the new hover + code action providers for workflow/action YAML documents during extension activation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 10 comments.
| File | Description |
|---|---|
| src/hover/actionVersionHoverProvider.ts | New hover provider that parses uses: lines and fetches latest version via GitHub API with caching. |
| src/hover/actionVersionCodeActionProvider.ts | New Quick Fix provider that offers in-place ref updates based on fetched latest version info. |
| src/extension.ts | Registers the new hover and code action providers for workflow/action document selectors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Extract shared module (actionVersionUtils.ts) to eliminate duplicated
parsing, caching, and API logic between hover and code action providers
- Use non-interactive getSession() to prevent auth prompts during
passive hover/code-action triggers
- Skip dynamic refs containing `${{` expressions to avoid corrupting
YAML with incorrect replacements
- Suppress Quick Fix for SHA-pinned action refs to preserve supply-chain
security posture
- Remove unnecessary `md.isTrusted = true` on hover MarkdownString
- Respect CancellationToken in both providers to abort early on stale
requests
- Fix misleading "latest semver" comment to match actual date-sorted
tag selection behavior
Closes#326
Summary
When hovering over a
uses:directive in workflow files, the extension now shows the latest available version of the referenced action alongside the existing language server hover (action name + description).If the current version is outdated, a Quick Fix code action is available to update the version in-place.
How it works
VS Code natively merges hover results from multiple providers. The language server continues to provide action name, description, and link — our new provider adds version information below it, separated by a divider.
Screenshots
Hover tooltip showing latest version:
Quick Fix code action:
Testing
.github/workflows/filesuses: owner/repo@refline → see latest version in tooltipCmd+.→ select update action