-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fetching tags doesn't work #206
Comments
what about |
Also curious whether performed from a fork pr |
The suggested command also fails for me with no kind of error message:
I tried quoting the refspec thinking it might be bash globbing issue
This works for me
Not from a fork for me, this is from a branch force (could that be relevant?) push What's with the lack of error message from git - is there some kind of additional layer here? |
This using suggested in actions/checkout#206 way to fetch tags. This reverts commit 6a30664.
This using suggested in actions/checkout#206 way to fetch tags. This reverts commit 6a30664.
I still cannot get tags to work for me. Tried with:
And:
Neither do the trick for me. |
Same here |
Giving up, until some clues are given here: actions/checkout#206
Other than ruling out fork vs non-fork, I wonder whether there is a difference with the token? Could try a PAT (see |
My repo is not a fork if that helps. |
This works for me: on: push
jobs:
build:
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
with:
repository: thoward27/semantic-release
- run: |
git fetch --unshallow --tags
echo $?
git tag --list |
Also confirmed with on: push
jobs:
build:
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
with:
repository: thoward27/semantic-release
- run: |
git fetch --prune --unshallow --tags
echo exit code $?
git tag --list |
Here's the output from the
|
If those same commands dont work for you, would be good to try with a PAT or deploy key. Will help narrow whether something weird about the built-in token for your account. |
This worked for me (at first I tried the readme instructions): - with:
- fetch-depth: 0
- name: Get all git tags
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
+ run: git fetch --prune --unshallow --tags
|
I also tried the README and then found the answer at #206 (comment) . Would be nice to fix the README. Thanks for making GitHub Actions accessible for OSS! Unlike others, I use fork. |
@pllim thanks, fixed here |
Closing. Reopen if any issues. |
By default, Github Actions checkout does a shallow clone and does not fetch tag information, that we need for versioning. See actions/checkout#206
The checkout action does not fetch any tags resulting in `git describe` failing. The recommended solution `git fetch --prune --unshallow --tags` of actions/checkout#206 has the drawback that a full clone gets created defeating the optimization attempts of the action. After a lot of try-and-error it was discovered that `git fetch --prune --depth=1 --tags` transfers much less data at the cost that `git describe` can only find a tag if it is directly on the currently checked out ref. This is sufficient to describe release refs only.
<!-- For Coveo Employees only. Fill this section. CDX-764 --> ## Proposed changes GitHub does some funky stuff for the checkout. This seems to fix it. Inspired by actions/checkout#206 (comment) Before: https://github.com/coveo/cli/actions/runs/3252334483/jobs/5338428208 After: https://github.com/coveo/cli/actions/runs/3252358715/jobs/5338480219
…sed to generate the changelog, with thanks to actions/checkout#206 (comment)
I have tried almost every configuration of this action I can think of.
I am running:
I expect to see the tags from my repository in the output.
I am currently seeing nothing.
The text was updated successfully, but these errors were encountered: