Skip to content

Commit c9c7327

Browse files
authored
Merge pull request #14 from buildrun-tech/feature/updates-readme
cd: fix the step of generate release version
2 parents 6b3aa10 + 37f6fda commit c9c7327

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/cd.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
- name: Determine next version
7171
id: version
7272
run: |
73-
last_tag=$(git describe --abbrev=0 --always)
73+
last_tag=$(git describe --abbrev=0)
7474
commit_range="${last_tag}..HEAD"
7575
major=0
7676
minor=0
@@ -98,6 +98,13 @@ jobs:
9898
echo "NEW VERSION SHOULD BE => $new_version"
9999
echo "::set-output name=new_version::$new_version"
100100
101+
- name: Determine commits since last tag
102+
id: commits
103+
run: |
104+
last_tag=$(git describe --abbrev=0)
105+
commit_range="${last_tag}..HEAD"
106+
git log --pretty=format:"%h %s" "$commit_range" > commits.txt
107+
101108
- name: Create new tag
102109
run: git tag -a ${{ steps.version.outputs.new_version }} -m "Version ${{ steps.version.outputs.new_version }}"
103110
env:
@@ -106,7 +113,6 @@ jobs:
106113
- name: Generate release notes
107114
id: release_notes
108115
run: |
109-
touch commits.txt
110116
while IFS= read -r line; do
111117
commit_hash=$(echo "$line" | awk '{print $1}')
112118
commit_msg=$(echo "$line" | awk '{$1=""; print $0}')
@@ -147,6 +153,6 @@ jobs:
147153
tag_name: ${{ steps.version.outputs.new_version }}
148154
release_name: Release ${{ steps.version.outputs.new_version }}
149155
body: |
150-
echo "Release notes for version ${{ steps.version.outputs.new_version }}:"
156+
Release notes for version ${{ steps.version.outputs.new_version }}:
151157
cat release_notes.txt
152158
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)