Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 18, 2026

When resolving action versions dynamically, the system was replacing user-specified tags (e.g., "v4") with more precise versions from the cache (e.g., "v4.6.2") if they pointed to the same SHA. This caused version comments to flip unexpectedly between compilations.

Changes

  • Removed version replacement logic in GetActionPinWithData() that checked cache for "more precise" versions and substituted them
  • Added test TestGetActionPinWithData_ExactVersionResolution verifying exact tag resolution with dynamic resolver
  • Updated test expectations in existing tests to match new behavior (setup-node@v6 now resolves to v6, not v6.1.0)

Behavior

# Before: User specifies v4, system replaces with v4.6.2
uses: actions/upload-artifact@c5eb11a343de00d7472c5a5c6598bc1f1fd51144 # v4.6.2

# After: User specifies v4, system uses v4
uses: actions/upload-artifact@c5eb11a343de00d7472c5a5c6598bc1f1fd51144 # v4

Fallback to hardcoded pins (when no resolver available) remains unchanged - exact match preferred, semver-compatible fallback if needed.

Original prompt

In action pins manager:

When a GitHub action references "vX", resolve the sha for precisely that tag, not a more precise "vX.y.z" . Do not try to be smart with release versioning semantics. Just resolve the tag as is.

Add test


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 18, 2026 13:34
When resolving action versions (e.g., "v4"), the system now returns exactly
the requested version in the version comment, not a more precise version
like "v4.6.2". This fixes the issue where the system was trying to be smart
by replacing user-specified tags with more precise versions.

Changes:
- Removed isMorePreciseVersion logic from GetActionPinWithData
- Added test TestGetActionPinWithData_ExactVersionResolution to verify behavior
- Updated test expectations to match new exact-version behavior

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Updated test expectations in TestActionPinResolutionWithMismatchedVersions
to match actual hardcoded pin versions:
- ai-inference: v2 (not v2.0.4)
- github-script: v7 (exact match, not v8.0.0 fallback)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add test for resolving GitHub action tag references Fix action pins to resolve tags exactly as specified Jan 18, 2026
Copilot AI requested a review from pelikhan January 18, 2026 13:42
@pelikhan
Copy link
Contributor

@copilot recompile

Copy link
Contributor Author

Copilot AI commented Jan 18, 2026

@copilot recompile

Recompile completed successfully. All 129 workflows are up to date - no changes were generated since the action pins logic changes don't affect the existing compiled workflows.

@pelikhan pelikhan marked this pull request as ready for review January 18, 2026 13:56
@pelikhan pelikhan merged commit 8a8942c into main Jan 18, 2026
1 check passed
@pelikhan pelikhan deleted the copilot/resolve-tag-references-in-action-pins branch January 18, 2026 13:56
Sign up for free to 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.

2 participants