-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add input variable to allow overriding release title #45
Conversation
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.
@manue1 : Thank you for contributing again to the GitHub CLI! ✨
I think these changes are technically straightforward with a minor safeguard suggestion but also a philosophical question on how others would expect this input to behave.
action.yml
Outdated
- id: determine_release_title | ||
run: | | ||
if [ -n "$INPUT_TITLE" ]; then | ||
title=$INPUT_TITLE |
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.
title=$INPUT_TITLE | |
title="$INPUT_TITLE" |
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.
Addressed in 3bedb9f.
build_and_release.sh
Outdated
@@ -72,5 +72,5 @@ if gh release view "$GH_RELEASE_TAG" >/dev/null; then | |||
gh release upload "$GH_RELEASE_TAG" --clobber -- "${assets[@]}" | |||
else | |||
echo "creating release and uploading assets..." | |||
gh release create "$GH_RELEASE_TAG" $prerelease $draft_release --title="${GITHUB_REPOSITORY#*/} ${GH_RELEASE_TAG#v}" --generate-notes -- "${assets[@]}" | |||
gh release create "$GH_RELEASE_TAG" $prerelease $draft_release --title="${GH_RELEASE_TITLE} ${GH_RELEASE_TAG#v}" --generate-notes -- "${assets[@]}" |
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.
Would someone expect full control over the release title if GH_RELEASE_TITLE
is set or not?
This is the big question on my mind as build_and_release.sh
doesn't use the GH_RELEASE_TITLE
as-is but treats this more like a prefix.
If these changes had it such that it was full control over the title, then it means users would need a way to set this such that INPUT_TAG
could be used after it has been evaluated above. That's when this starts getting complicated.
Otherwise, should we rename this variable to avoid confusion?
@manue1 : what do you think?
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.
You're right, I actually missed on the first glance that the title string also included the tag. I have renamed it to title prefix in 38be18e for clarity. Let me know what you think.
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.
LGTM! Thank you again, Manuel!
if [ -n "$INPUT_TOKEN" ]; then | ||
token=$INPUT_TOKEN | ||
token="$INPUT_TOKEN" | ||
else | ||
token=$DEFAULT_TOKEN | ||
token="$DEFAULT_TOKEN" | ||
fi | ||
echo "TOKEN=$token" >> "$GITHUB_OUTPUT" |
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 for cleaning up some of the other code!
This is one of those oft forgotten and annoying shell script isms that https://github.com/koalaman/shellcheck would suss out but always awkward to ask a contributor to clean up our messes.
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.
No worries, easy to spot once you're at it but otherwise easy to miss!
In order to be able to provide a custom release title instead of the repository name, this PR introduces a
release_title
input variable.