fetch-tags: true doesn't actually fetch any tags
After https://github.com/actions/checkout/pull/579 was merged and released with v3.6.0, the `fetch-tags` option was introduced and it's kind of a breaking change for projects that depend on reading tags from the git history. It sets `--no-tags` in the `git fetch` command run by this action. I think this new option should have defaulted to `true` or introduced in v4 instead where it could possibly have had the default `false`. Nevertheless, using `fetch-tags: true` without overriding the default `fetch-depth: 1` actually doesn't fetch any tags unless the workflow was triggered by a tag push. So I think it's misleading and should be changed to fetch all tags if `fetch-tags` is set to `true`. The change to the `git fetch` command run by this action would be to append `'+refs/tags/*:refs/tags/*'` (`tagsRefSpec`) to the end even though `fetch-depth` is `> 0`. Related issue: https://github.com/actions/checkout/issues/1467 A possible workaround would be to run another `git fetch` after using this checkout action like in https://github.com/actions/checkout/pull/579#issuecomment-1615799806, but that feels hacky. Seems the author of the https://github.com/actions/checkout/pull/579 PR also discussed supporting my use-case here: https://github.com/actions/checkout/pull/579#issuecomment-1616149745 I'm sure that this added functionality would be very appreciated. Thanks for your consideration!
Posted by dataviruset on Sep 13, 2023, 10:15 AM
Tags
Related issues
Raise real-world problems, find people facing the same issue, and discuss solutions.2,000 issues0 comments
github (E-commerce)
proposal: cmd/cgo: cgo without a C toolchain
Replace PowerToys Run with Command Palette
VPS with a vRack leg
Possibility of Portal 1 Code Inclusion
Introducing NewPlayer
Metrics for PRs are never expiring ("memory leak")
ship even more of the compiler in source form
Flatpak Application TRACKING ISSUE
fetch-tags: true doesn't actually fetch any tags
After https://github.com/actions/checkout/pull/579 was merged and released with v3.6.0, the `fetch-tags` option was introduced and it's kind of a breaking change for projects that depend on reading tags from the git history. It sets `--no-tags` in the `git fetch` command run by this action. I think this new option should have defaulted to `true` or introduced in v4 instead where it could possibly have had the default `false`. Nevertheless, using `fetch-tags: true` without overriding the default `fetch-depth: 1` actually doesn't fetch any tags unless the workflow was triggered by a tag push. So I think it's misleading and should be changed to fetch all tags if `fetch-tags` is set to `true`. The change to the `git fetch` command run by this action would be to append `'+refs/tags/*:refs/tags/*'` (`tagsRefSpec`) to the end even though `fetch-depth` is `> 0`. Related issue: https://github.com/actions/checkout/issues/1467 A possible workaround would be to run another `git fetch` after using this checkout action like in https://github.com/actions/checkout/pull/579#issuecomment-1615799806, but that feels hacky. Seems the author of the https://github.com/actions/checkout/pull/579 PR also discussed supporting my use-case here: https://github.com/actions/checkout/pull/579#issuecomment-1616149745 I'm sure that this added functionality would be very appreciated. Thanks for your consideration!
Comments (0)
No comments yet. Start the discussion.