{{ message }}
Repository navigation
Fix tag handling: preserve annotations and explicit fetch-tags - #2356
Merged
Merged
Conversation
ericsciple
force-pushed
the
users/erisciple/26-01-tags
branch
7 times, most recently
from
January 8, 2026 23:59
f12cf15 to
a70240b
Compare
ericsciple
commented
Jan 9, 2026
ericsciple
force-pushed
the
users/erisciple/26-01-tags
branch
from
January 9, 2026 00:26
a70240b to
849c4d7
Compare
ericsciple
commented
Jan 9, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes multiple tag handling issues in the checkout action by changing how tags are fetched and verified.
- Tags are now fetched by reference (not commit hash) to preserve annotations
- The
fetch-tagsoption now properly controls tag fetching via explicit refspecs - Added validation to detect when tags have been moved after workflow trigger (for shallow fetches)
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/ref-helper.ts | Modified getRefSpec to accept fetchTags parameter and fetch tags by ref instead of commit; updated testRef to use ^{commit} for annotated tag dereferencing |
| src/git-source-provider.ts | Removed fetchTags from fetch options (now in refspec); added tag movement validation for shallow fetches |
| src/git-command-manager.ts | Removed fetchTags option from fetch method; always use --no-tags with explicit tag control via refspecs |
| test/ref-helper.test.ts | Added comprehensive tests for new fetchTags parameter behavior |
| test/git-command-manager.test.ts | Updated tests to reflect new fetch behavior with --no-tags always present |
| test/verify-fetch-tags.sh | New script to verify tags are properly fetched in E2E tests |
| .github/workflows/test.yml | Added E2E test for fetch-tags: true functionality |
| dist/index.js | Compiled changes matching source modifications |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR fixes several issues with tag handling in the checkout action: 1. fetch-tags: true now works (fixes #1471) - Tags refspec is now included in getRefSpec() when fetchTags=true - Previously tags were only fetched during a separate fetch that was overwritten by the main fetch 2. Tag checkout preserves annotations (fixes #290) - Tags are fetched via refspec (+refs/tags/*:refs/tags/*) instead of --tags flag - This fetches the actual tag objects, preserving annotations 3. Tag checkout with fetch-tags: true no longer fails (fixes #1467) - When checking out a tag with fetchTags=true, only the wildcard refspec is used (specific tag refspec is redundant) Changes: - src/ref-helper.ts: getRefSpec() now accepts fetchTags parameter and prepends tags refspec when true - src/git-command-manager.ts: fetch() simplified to always use --no-tags, tags are fetched explicitly via refspec - src/git-source-provider.ts: passes fetchTags to getRefSpec() - Added E2E test for fetch-tags option Related #1471, #1467, #290
ericsciple
force-pushed
the
users/erisciple/26-01-tags
branch
from
January 9, 2026 01:45
849c4d7 to
dc12339
Compare
TingluoHuang
reviewed
Jan 9, 2026
TingluoHuang
approved these changes
Jan 9, 2026
This was referenced Jan 9, 2026
|
@ericsciple This is fixed in v6.0.2 but that is marked as a pre-release. Was that a mistake and, if not, why not mark it as -beta? This is causing action updates tools to skip/flag it, so I wanted to make sure you were aware of that release marker. |
Contributor
Author
1 task
luketainton
pushed a commit
to luketainton/luke_instant-msg-api
that referenced
this pull request
Jan 22, 2026
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/checkout](https://github.com/actions/checkout) | action | patch | `v6.0.1` → `v6.0.2` | --- ### Release Notes <details> <summary>actions/checkout (actions/checkout)</summary> ### [`v6.0.2`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v602) [Compare Source](actions/checkout@v6.0.1...v6.0.2) - Fix tag handling: preserve annotations and explicit fetch-tags by [@​ericsciple](https://github.com/ericsciple) in [#​2356](actions/checkout#2356) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi44OS4yIiwidXBkYXRlZEluVmVyIjoiNDIuODkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsidHlwZS9kZXBlbmRlbmNpZXMiXX0=--> Reviewed-on: https://git.tainton.uk/luke/instant-msg-api/pulls/238 Reviewed-by: Luke Tainton <luke@tainton.uk> Co-authored-by: renovate[bot] <renovate-bot@git.tainton.uk> Co-committed-by: renovate[bot] <renovate-bot@git.tainton.uk>
luketainton
pushed a commit
to luketainton/actions_gha-workflows
that referenced
this pull request
Jan 22, 2026
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/checkout](https://github.com/actions/checkout) | action | patch | `v6.0.1` → `v6.0.2` | --- ### Release Notes <details> <summary>actions/checkout (actions/checkout)</summary> ### [`v6.0.2`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v602) [Compare Source](actions/checkout@v6.0.1...v6.0.2) - Fix tag handling: preserve annotations and explicit fetch-tags by [@​ericsciple](https://github.com/ericsciple) in [#​2356](actions/checkout#2356) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi44OS4yIiwidXBkYXRlZEluVmVyIjoiNDIuODkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsidHlwZS9kZXBlbmRlbmNpZXMiXX0=--> Reviewed-on: https://git.tainton.uk/actions/gha-workflows/pulls/58 Co-authored-by: renovate[bot] <renovate-bot@git.tainton.uk> Co-committed-by: renovate[bot] <renovate-bot@git.tainton.uk>
This was referenced Jan 22, 2026
This was referenced Aug 7, 2026
This was referenced Aug 16, 2026
Merged
This was referenced Aug 23, 2026
1 task
This was referenced Sep 19, 2026
This was referenced Oct 21, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Fixes multiple issues with tag handling in the checkout action.
Issues Fixed
1.
fetch-tags: truedoesn't fetch tags (#1471)Previously, when using
fetch-tags: trueon a branch checkout, tags were not actually fetched. Now tags are properly included in the fetch refspec.2. Annotated tags converted to lightweight (#290)
When checking out an annotated tag, the tag annotation was lost because the action fetched by commit hash rather than by tag reference. Now tags are fetched via explicit refspec (
+refs/tags/*:refs/tags/*), which fetches the actual tag objects and preserves annotations.3. Fatal error with tag +
fetch-tags: true(#1467)Checking out a tag with
fetch-tags: truecaused a fatal error due to duplicate refspecs. Now only the wildcard refspec is used (the specific tag is redundant when fetching all tags).Testing
Unit Tests
Added new unit tests.
E2E Tests