Comments (10)
@zakkak try refs/tags/5.194.3
, what's the runner version you have?
from checkout.
Yes, the branch gets preferred, the output will give you some hints. :)
git checkout v1.5.2
warning: refname 'v1.5.2' is ambiguous.
Switched to branch 'v1.5.2'
from checkout.
I think the command runs with --tags
now, so I guess this issue can be closed.
from checkout.
You can do that with the ref
input.
from checkout.
I have tried ref
and it still uses --no-tags
when fetching.
Specifically I use:
- uses: actions/checkout@v1
with:
repository: graalvm/mx.git
ref: 5.194.3
path: $GITHUB_WORKSPACE/mx
And the result is:
...
git -c http.extraheader="AUTHORIZATION: basic ***" fetch --no-tags --prune --progress --no-recurse-submodules origin +refs/heads/*:refs/remotes/origin/*
...
git checkout --progress --force 5.194.3
##[error]error: pathspec '5.194.3' did not match any file(s) known to git
from checkout.
Using refs/tags/5.194.3
did the trick (It would be nice to support 5.194.3
as well, I guess it might be ambiguous though).
Thank you!
Current runner version: '2.157.3'
from checkout.
Apparently the runner release process has some setting problem, you should get 2.157.5 now which should allow you just do:
- uses: actions/checkout@v1
with:
ref: 5.194.3
We suppose to fetch all tags in checkout@V1, so ref: 5.194.3
should be good enough.
from checkout.
@zakkak thanks for bringing this up so I can realize the setting problem. 🙇
from checkout.
@TingluoHuang what happens if I have both a branch and a tag with the same name?
I think the branch get highest priority right? This could be pretty confusing and hard to debug.
from checkout.
Thanks folks, I am aware of the ref
option however that's not specifically what I'm looking for. Let me see if I can provide a bit more context as to what we're doing:
We derive version numbers for our applications and libraries using their git tag
history. This information is gathered using a combination of git describe --tags --first-parent
and git rev-parse --short HEAD
. For the former to work correctly, we need to have the collection of tags available in our local repo - however when using --no-tags
this is obviously not the case.
In our specific use case, explicitly fetching a single tag using the ref
option does not provide what we're looking for since we do not know ahead of time which tag it is that we're interested in for the purpose of git describe
.
from checkout.
Related Issues (20)
- bug: sparse-checkout checks out undefined paths HOT 2
- patch-diff.githubusercontent.com/raw/paypal-examples/docs-examples/pull/121.patch
- Getting Error in "Determining the checkout info" step of actions/[email protected] HOT 1
- Checkout action with branch as ref not consistent through workflow
- tag checkout action overwrites tag with pointed-to commit
- Feature request: add cacheing
- Code signing key has expired
- checkout not overriding GITHUB_SHA
- Epicrepairs
- Need
- Last release failing due to sparse-checkout HOT 8
- 4.1.2 enables sparse-checkout on builds that didn't ask for it HOT 1
- Can I check out a new branch?
- Why don't you write the default value in the `description` in the `inputs` options?
- Improve error reporting for no such reference
- Improve error reporting for repository reference with `@`
- fetch-tags=true do not work when fetch-depth > 0 HOT 3
- action/checkout HOT 1
- actions/checkout@v4 does not work on self-hosted ubuntu 22.04 HOT 1
- Tag is fetched but checkout complains for not existing ref HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from checkout.