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

Issue with actions/checkout@v2 #10

Closed
ahaverbuch opened this issue Jan 28, 2020 · 6 comments
Closed

Issue with actions/checkout@v2 #10

ahaverbuch opened this issue Jan 28, 2020 · 6 comments

Comments

@ahaverbuch
Copy link

Thanks for a useful action!

We noticed this in one of our projects; https://github.com/actions/checkout is called before phips28/gh-action-bump-version, and that worked great in actions/checkout@v1 of it.

In actions/checkout@v2, they changed to no longer use a detached HEAD at first, instead to use a branch directly; this causes gh-action-bump-version to fail.

Appears this is because gh-action-bump-version is trying to make the same commit twice (once on the initial branch, and once when checking out the second branch) - as those are now the same. (error line is here: https://github.com/phips28/gh-action-bump-version/blob/v5.0.19/index.js#L55 )

We got the same error @benitazhang mentioned here be1eb84#commitcomment-36934730 - failing when running git commit -a -m ci: version bump to [version]

(it is not related to the quotes change though, as that change works fine with actions/checkout@v1 - thanks for fixing that!)

@phips28
Copy link
Owner

phips28 commented Jan 28, 2020

nice find.
but I am not sure how to solve it to work for v1 and v2 (I dont want to break checkout@v1 usages).
Do you have any idea?

@ahaverbuch
Copy link
Author

maybe skip the first part if on a detached HEAD? not sure that whole section is needed on v2.

Something like this git rev-parse --abbrev-ref --symbolic-full-name HEAD should tell you if you are on HEAD or a branch.

@zkoppert
Copy link

zkoppert commented Mar 9, 2020

Just wanted to note that I was having trouble getting this action to work but saw @ahaverbuch note here about v1 vs v2 and that helped me. Thanks for opening the issue! This saved me lots of time debugging.

@ffMathy
Copy link

ffMathy commented Mar 26, 2020

V2 support is quite crucial.

@sarink
Copy link

sarink commented Apr 3, 2020

Most other actions nowadays don't support checkout v1, making this lib incompatible and impossible to integrate in many workflows. Is there any workaround for using this with v2?

@phips28
Copy link
Owner

phips28 commented Apr 3, 2020

ok, I finally had time to fix that :)
#14

@phips28 phips28 closed this as completed Apr 3, 2020
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

5 participants