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 error messages in check-release.sh
#3799
Conversation
.github/scripts/check-release.sh
check-release.sh
d8d2cd0
to
2a903a0
Compare
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.
Hey @vvv.
There are a lot of good ideas here, but it doesn’t work anymore. Try to run the script before and after your PR, and you’ll see.
On my computer here are the results;
irevoire@macbook-pro-4 ~/clean/MeiliSearch 🌱 % bash .github/scripts/check-release.sh
Error: the current tag does not match the version in Cargo.toml: found - expected 1.2.0
Error: the current tag does not match the version in Cargo.toml: found Cargo.lock - expected 1.2.0
1 irevoire@macbook-pro-4 ~/clean/MeiliSearch 🍐 % gh pr checkout 3799
Switched to branch 'fix.check-release-script'
irevoire@macbook-pro-4 ~/clean/MeiliSearch 🍴 % bash .github/scripts/check-release.sh
.github/scripts/check-release.sh: line 7: $3: unbound variable
Hey @irevoire, Thanks for looking at the patch. (Also, nice shell prompt! 🧑🏼🌾 Pretty organic.)
When you ran the script on your laptop, current_tag=${GITHUB_REF#'refs/tags/v'}
file_tag="$(cat Cargo.toml | read_version)"
check_tag $current_tag $file_tag Cargo.toml || ret=1
When CI runs the script,
Still, the UX is bad. Let me improve error reporting... |
2a903a0
to
5dab6ea
Compare
check-release.sh
check-release.sh
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.
That looks good to me. @curquiza I don’t know how to test it on our CI though 😬
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
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.
Hello
Thanks for your PR @vvv
Th change you made for the current script does not work as expected.
Our tags start with v
, and if I try to do the following commands, I have an error:
bash-3.2$ export GITHUB_REF=v1.2.0
bash-3.2$ bash .github/scripts/check-release.sh
Error: GITHUB_REF is not a valid tag: v1.2.0
@curquiza GitHub adds ❯ GITHUB_REF=refs/tags/v1.2.0 bash .github/scripts/check-release.sh
OK See https://docs.github.com/en/actions/learn-github-actions/variables :
|
I didn't mean to dismiss the review. I guess the repository is configured to auto-dismiss the review once the PR's branch is updated.
|
Yes don't worry I know 😄
Oh sorry @vvv, my bad, the worst part is I read what you wrote last week 🙈 I'm not a morning person definitely @vvv |
- `check_tag`: Report file name correctly. Use named variables. - Introduce `read_version` helper function. Simplify the implementation. - Show meaningful error message if `GITHUB_REF` is not set or its format is incorrect.
685422a
to
cfed349
Compare
@curquiza Sure. I've removed the |
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.
thank you @vvv 🙏 for your work, reactivity and involvement
bors merge
Build succeeded:
|
check_tag
: Report file name correctly. Use named variables.read_version
helper function. Simplify the implementation.GITHUB_REF
is not set or its format is incorrect.