-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Fix release tag commit #6021
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
Fix release tag commit #6021
Conversation
|
ernestognw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. Thanks for looking into this @james-toussaint!
Any idea why the github.ref_name is empty in some contexts?
WalkthroughThe release workflow now explicitly captures the Git commit hash and passes it through to the GitHub release creation script. A new workflow step writes the current commit hash to the environment variable RELEASE_COMMIT. The github-release.js script validates this variable and uses it as the target_commitish for release creation instead of github.ref_name. The script includes error handling to exit if the environment variable is missing. Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
Here |
Amxx
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we able to test it without doing a release ?
Worst case the tag is not correct, and we fix it manually like before ... until we finally find the correct fix. But ideally I'd like to not do this kind of (slow) trial and error.
Alternativally, any code out these uses a similar workflow ? Can we check which value they use ?
Tested with Github Actions in personal fork (links in PR description). (I can give you access to jobs if you need to) We would need to setup some sort of full staging env (kind of similar to what I did with my personal fork), accessible to everyone internally. Not sure it's worth it here. Here is a similar example/workflow. |
|
🤯 The docs here were the cause of the confusion: https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#github-context The "context" is called TypeScript would've caught this! |
Fixes #4699
The
github.ref_namehappens to be empty, which makestarget_commitishempty.If
target_commitishis empty, it defaults to the repository's default branch (here master), hence the release tag, created during Create Release Github API call, is attached to the wrong commit. (See create-a-release).PR Checklist
Tests
Release tag is attached to the latest commit of the branch being built by the release job.
Test diff compared to current branch parent commit
Documentation