Skip to content

feat: Show latest version of action in hover tooltip - #584

Open
ZiuChen wants to merge 2 commits into
github:mainfrom
ZiuChen:feat/actions-version
Open

feat: Show latest version of action in hover tooltip#584
ZiuChen wants to merge 2 commits into
github:mainfrom
ZiuChen:feat/actions-version

Conversation

@ZiuChen

Copy link
Copy Markdown

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:

showcase-latestshowcase-legacy

Quick Fix code action:

showcase-quick-fix

Testing

  1. Open a project with .github/workflows/ files
  2. Hover over any uses: owner/repo@ref line → see latest version in tooltip
  3. Place cursor on an outdated action → press Cmd+. → select update action

- Add quick fix when new version avaliable
CopilotAI review requested due to automatic review settings April 10, 2026 09:14
@ZiuChen
ZiuChen requested a review from a team as a code ownerApril 10, 2026 09:14

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 @ref to 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.

FileDescription
src/hover/actionVersionHoverProvider.tsNew hover provider that parses uses: lines and fetches latest version via GitHub API with caching.
src/hover/actionVersionCodeActionProvider.tsNew Quick Fix provider that offers in-place ref updates based on fetched latest version info.
src/extension.tsRegisters 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.

Comment threadsrc/hover/actionVersionHoverProvider.ts Outdated
Comment threadsrc/hover/actionVersionHoverProvider.ts Outdated
Comment threadsrc/hover/actionVersionHoverProvider.ts
Comment threadsrc/hover/actionVersionCodeActionProvider.ts Outdated
Comment threadsrc/hover/actionVersionCodeActionProvider.ts Outdated
Comment threadsrc/hover/actionVersionCodeActionProvider.ts
Comment threadsrc/hover/actionVersionCodeActionProvider.ts Outdated
Comment threadsrc/hover/actionVersionCodeActionProvider.ts Outdated
Comment threadsrc/hover/actionVersionCodeActionProvider.ts Outdated
Comment threadsrc/hover/actionVersionHoverProvider.ts Outdated
- 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
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

show latest version of action in hover tooltip

2 participants

@ZiuChen