Skip to content

Commit

Permalink
fix(generate-release-description): Fix inconsistent style of the rele…
Browse files Browse the repository at this point in the history
…ase description content when the project has a single release tag

The `git_log_opts` array variable isn't initialized before being referenced in the single commit if case:

https://gitlab.com/the-common/project-template/-/blob/daebf87b/continuous-integration/generate-release-description.sh#L52

This patch moves the assignment of the `git_log_opts` array variable at

https://gitlab.com/the-common/project-template/-/blob/daebf87b/continuous-integration/generate-release-description.sh#L107

before the `if` built-in command call.

Signed-off-by: 林博仁(Buo-ren Lin) <buo.ren.lin@gmail.com>
  • Loading branch information
brlin-tw committed Oct 1, 2024
1 parent daebf87 commit 5ef45c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions continuous-integration/generate-release-description.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ if test -v CI_COMMIT_TAG; then
release_tag="${CI_COMMIT_TAG}"
fi

git_log_opts=(
--format='format:* %s (%h) - %an'
)
if test "${git_tag_count}" -eq 1; then
printf \
'Info: Only one release tag was detected, generating the release description text from the very beginning to the "%s" release tag...\n' \
Expand Down Expand Up @@ -104,9 +107,6 @@ else
"${previous_git_tag}" \
"${release_tag}" \
1>&2
git_log_opts=(
--format='format:* %s (%h) - %an'
)
if ! detailed_changes_markup+="$(
git log \
"${git_log_opts[@]}" \
Expand Down

0 comments on commit 5ef45c6

Please sign in to comment.