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:
40
40
repo_url="https://github.com/${{ github.repository }}"
41
41
git fetch --prune --unshallow
42
42
previous_tag=$(git tag --sort=-creatordate | head -n 1)
43
+ current_sha=$(git rev-parse HEAD)
43
44
if [ -z "$previous_tag" ]; then
44
45
range=""
46
+ compare_url="${repo_url}/commit/${current_sha}"
47
+ changelog="Commit changes for [HEAD](${compare_url}):"$'\n'
48
+ log_range="HEAD"
45
49
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}"
47
55
fi
48
- changelog="Commit changes for **$range**:"$'\n'
49
56
while read -r hash message; do
50
57
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 "")
52
59
echo "changelog<<EOF" >> $GITHUB_OUTPUT
53
60
echo "$changelog" >> $GITHUB_OUTPUT
54
61
echo "EOF" >> $GITHUB_OUTPUT
You can’t perform that action at this time.
0 commit comments