File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -40,15 +40,22 @@ jobs:
4040 repo_url="https://github.com/${{ github.repository }}"
4141 git fetch --prune --unshallow
4242 previous_tag=$(git tag --sort=-creatordate | head -n 1)
43+ current_sha=$(git rev-parse HEAD)
4344 if [ -z "$previous_tag" ]; then
4445 range=""
46+ compare_url="${repo_url}/commit/${current_sha}"
47+ changelog="Commit changes for [HEAD](${compare_url}):"$'\n'
48+ log_range="HEAD"
4549 else
46- range="$previous_tag..HEAD"
50+ range="${previous_tag}..${current_sha}"
51+ display_range="${previous_tag}..HEAD"
52+ compare_url="${repo_url}/compare/${previous_tag}...${current_sha}"
53+ changelog="Commit changes for [${display_range}](${compare_url}):"$'\n'
54+ log_range="${previous_tag}..${current_sha}"
4755 fi
48- changelog="Commit changes for **$range**:"$'\n'
4956 while read -r hash message; do
5057 changelog="${changelog}* [${message}](${repo_url}/commit/${hash})"$'\n'
51- done < <(git log $range --pretty=format:"%H %s"; echo "")
58+ done < <(git log ${log_range} --pretty=format:"%H %s"; echo "")
5259 echo "changelog<<EOF" >> $GITHUB_OUTPUT
5360 echo "$changelog" >> $GITHUB_OUTPUT
5461 echo "EOF" >> $GITHUB_OUTPUT
You can’t perform that action at this time.
0 commit comments