-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
allow fetch tags too #701
Comments
Using checkout/src/git-command-manager.ts Lines 175 to 177 in ec3a7ce
Apparently, this might not be enough depending on your workflow. I‘m currently trying to implement this for koraktor/mavanagaiata which checks if the commit is tagged before releasing a new version. This check fails and I‘m still trying to find the cause for this. |
It is correct that if you add But this leaves you with two choices:
If you need the latest tag, then the first won't work at all. We should be able to get a bounded number of recent commits and tags by specifying some options. |
See also: #448 |
As a workaround, you can fetch tags as a step after the - name: Checkout
uses: actions/checkout@v3
- name: Get tags
run: git fetch --tags origin As I understand it, this will fetch all tags but that's preferable to fetching all history when you want a tag. |
This would be really useful so that things like dolfinus/setuptools-git-versioning would work in Actions |
@anthony-steele-cko Thanks for your suggested workaround. Unfortunately, I get the error:
despite |
after git fetch --tags: had to do fetch-depth: 0 |
Ran into this today as well. Turns out there is already a PR for this too: #579. Hopefully the maintainers can merge it soon, because I really don't fancy setting fetch_depth=0 on large, old repositories. Also, the link between fetch_depth and the fetching or not of tags is undocumented behavior, and I don't like having to rely on undocumented behavior. |
Very useful feature. Please implement. |
Ran into same problem recently. It's because it's not fetching the entire commit history if depth >0, so you'll only get tags for the the commits that are fetched within the specified depth. If the tags are older than depth, tough luck. I can also confirm the workaround with fetching the entire history solves the problem using
|
…ilable) see actions/checkout#701 for further info
Fix taken from: actions/checkout#701 (comment)
Manually fetch the Git tags, as this is currently not possible with the default checkout action. See actions/checkout#701 for detailed information. Signed-off-by: Martin Schwan <m.schwan@phytec.de>
@anthony-steele-cko I'm not sure this works well. If I do So I'm not sure that what this task is trying to achieve actually is feasible. Because it might looks like git issue, and not Github Action issue. Or do I miss something? I'm trying it locally first with the latest |
This requires the `bootstrap/1` tag, which we have to fetch explicitly on the test runners (see actions/checkout#701).
It looks like the PR adding this functionality got merged recently: #579, and is available in versions >=3.6.0. I think this issue can be closed now. |
@nmoroze , I'm trying to use the option My repository has 4 tags (https://github.com/podStation/podStation-test-new-pipeline/tags), the fetch command from I compare the current version of my package with the latest tag in the pipeline to trigger my release and deployment in case there was a change in the version. Have I understood the purpose of the option |
I tried that and it works for me. However I specified In my case I need just last commit with tag. Based on our release strategy it most likely is within 5 last commits on master. So I fetch 20 just not to hit some edge case and works perfectly. |
@arxeiss thank you, I though it would be something like that, but I did not test it yet. |
current it will add
--no-tags
but i hope can fetch tag too
that is help when wanna build changelog base on tag in github actions
The text was updated successfully, but these errors were encountered: