Skip to content
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

Action fails when triggered by a tag. #24

Open
rosiel opened this issue Sep 27, 2023 · 4 comments
Open

Action fails when triggered by a tag. #24

rosiel opened this issue Sep 27, 2023 · 4 comments

Comments

@rosiel
Copy link
Contributor

rosiel commented Sep 27, 2023

We are using the FOLLOW_TAGS option and have set up our Github workflow to trigger on tag creation.

The result is, after creating tag 2.9.0,

error: pathspec '.9.0' did not match any file(s) known to git
fatal: ref HEAD is not a symbolic ref

I suspect that this is caused by line 25, git checkout "${GITHUB_REF:11}". When the GITHUB_REF is refs/heads/<branch_name> this works, but when it's refs/tags/<tag_name> it cuts the first letter off the tag name.

I think this could be solved by using $GITHUB_REF_NAME which is "The short ref name of the branch or tag that triggered the workflow run. This value matches the branch or tag name shown on GitHub. For example, feature-branch-1" Source: https://docs.github.com/en/actions/learn-github-actions/variables

@lwih
Copy link

lwih commented Oct 16, 2023

I upvote this issue as I'm facing the same one.
@rosiel - did you find a solution?

@rosiel
Copy link
Contributor Author

rosiel commented Oct 17, 2023

No, I'm hoping @SvanBoxel has a chance to look at this - the solution should be as simple as switching out $GITHUB_REF:11 with $GITHUB_REF_NAME.

@SvanBoxel
Copy link
Owner

Hi @rosiel. Could you test your solution and open a PR if you're confident it works? Thank you!

@SvanBoxel
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants