Coder Social home page Coder Social logo

Comments (10)

TingluoHuang avatar TingluoHuang commented on June 4, 2024 1

@zakkak try refs/tags/5.194.3, what's the runner version you have?
image

from checkout.

TingluoHuang avatar TingluoHuang commented on June 4, 2024 1

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.

datapythonista avatar datapythonista commented on June 4, 2024 1

I think the command runs with --tags now, so I guess this issue can be closed.

from checkout.

jednano avatar jednano commented on June 4, 2024

You can do that with the ref input.

from checkout.

zakkak avatar zakkak commented on June 4, 2024

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.

zakkak avatar zakkak commented on June 4, 2024

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.

TingluoHuang avatar TingluoHuang commented on June 4, 2024

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.

TingluoHuang avatar TingluoHuang commented on June 4, 2024

@zakkak thanks for bringing this up so I can realize the setting problem. 🙇

from checkout.

zakkak avatar zakkak commented on June 4, 2024

@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.

notheotherben avatar notheotherben commented on June 4, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.