-
Notifications
You must be signed in to change notification settings - Fork 652
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
gitversion from container image default behaviour differs from other installation methods #4042
Comments
@f2calv thank you for the detailed description. I will move the issue to the |
@f2calv do you mind to test with the The |
Additionally on GitHub Actions you need to specify these env vars when executing docker run https://github.com/GitTools/GitVersion/blob/main/build/common/Utilities/DockerContextExtensions.cs#L263-L270 |
Thanks @arturcic for the pointers, sorry for delay, I have experimented with;
Note: AFAIK this is just a default MainLine configuration file, I use the file mainly as an 'identifier' to let me/others know the repository versioning is managed by GitVersion; mode: Mainline
branches: {}
ignore:
sha: []
merge-message-formats: {} Push request build;
Pull request build;
Conclusions;
Did I miss anything? |
Yes, please check https://github.com/GitTools/GitVersion/blob/main/BREAKING_CHANGES.md#configuration-changes
I checked the log, I suspect you should re-run the job as it seems an GH Actions issue
Yes, you got it right, I think we need to update the docs on DockerHub and specify the usage when running in a CI environment |
🎉 This issue has been resolved in version 6.0.0-rc.2 🎉 Your GitReleaseManager bot 📦🚀 |
Hi,
Firstly, love GitVersion, thanks to all contributors :)
Secondly, I've been experimenting with different methods of installing GitVersion in my GitHub workflows and believe I've found an anomaly in the containerised version... or at least something I can't explain, so I hope someone can shed some light here...
I one workflow am runinng 3 parallel jobs, each installing and executing GitVersion via 3 different mechanisms;
Here is the workflow I am executing;
https://github.com/f2calv/playground-gitversion/blob/f2calv/2024-05-checkout-testing/.github/workflows/test.yml
On a simple push trigger everything works as expected, actions/checkout checks out the HEAD;
On a Pull Request trigger the containerised version of GitVersion fails, actions/checkout checks out a MERGE commit;
The initial error is ERROR: fatal: detected dubious ownership in repository at '/repo'. If I then attempt to override the entrypoint in the container by setting safe.directory then GitVersion executes a little further but ultimately fails with Gitversion could not determine which branch to treat as the development branch, I got the safe-directory idea from another issue GitTools/build-images#34.
I would expect all three installation mechanisms of GitVersion to act the same.
Note: If I override the actions/checkout ref with github.event.pull_request.head.sha the containerised version works as expected.
The text was updated successfully, but these errors were encountered: