Skip to content

Commit

Permalink
Fix release workflow when failed to generate changelog
Browse files Browse the repository at this point in the history
Signed-off-by: Gaoyang Zhang <[email protected]>
  • Loading branch information
blurgyy committed Oct 6, 2021
1 parent 08d7c88 commit e8bf8fb
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ jobs:
- name: Generate changelog
id: changelog
run: |
prev_tag=$(git describe --abbrev=0 --tags ${{ github.ref }}^)
log=$(git log --oneline --decorate=no $prev_tag..${{ github.ref }})
log="${log//'%'/'%25'}"
log="${log//'~'/\\~}"
log="${log//$'\n'/'%0A'}"
log="${log//$'\r'/'%0D'}"
echo "::set-output name=value::$log"
if prev_tag=$(git describe --abbrev=0 --tags ${{ github.ref }}^); then
log=$(git log --oneline --decorate=no $prev_tag..${{ github.ref }})
log="${log//'%'/'%25'}"
log="${log//'~'/\\~}"
log="${log//$'\n'/'%0A'}"
log="${log//$'\r'/'%0D'}"
echo "::set-output name=value::$log"
else
echo "::set-output name=value::log generation failed"
fi
- name: Strip debug symbols
id: strip
run: |
Expand Down

0 comments on commit e8bf8fb

Please sign in to comment.