Correctly work when there are no labels #11
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fix comes from @jemc.
This script is using
set -e
so that errors won't go unnoticed.But when commands are piped together, only the exit status of the
final command matters.
The
grep
command obviously fails when none of the tags are presentto find, which is causing the script to crash in that case. But it
seems that
awk
was always returning a success exit status even whenthe
grep
failed, so that explains why we didn't see that issue whenthe
awk
was the final command.The
true
command returns success unconditionally and prints nothing.So, adding
|| true
has the desired effect of explicitlyignoring/consuming the error from
grep
, while printing nothing intothe output stream of the subshell, so that the
CHANGELOG_TYPES
variable will be an empty string in that case like we want.
Closes #9