Skip to content

Commit

Permalink
Handle merge commits / versioning more gracefully (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeage authored Jan 27, 2022
1 parent 00dfd93 commit 83f5102
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
id: version
run: |
MAJOR_MINOR=$(git describe --tags --abbrev=0 --match "v[0-9]*.[0-9]*" ${{ github.event.pull_request.head.sha }})
PATCH_VERSION=$(git describe --tags --match "v[0-9]*.[0-9]*" ${{ github.event.pull_request.head.sha }} | cut -d'-' -f2)
PATCH_VERSION=$(git describe --tags --match "v[0-9]*.[0-9]*" --first-parent ${{ github.event.pull_request.head.sha }} | cut -d'-' -f2)
STAMP=$(git describe --tags --match "v[0-9]*.[0-9]*" ${{ github.event.pull_request.head.sha }} | cut -d'-' -f3)
if [ $PATCH_VERSION == $MAJOR_MINOR ]
then
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
else
PREV=$(git describe --tags --match "v[0-9]*.[0-9]*" --abbrev=0 HEAD^)
fi
CHANGELOG=$(git log --pretty=oneline $PREV..HEAD)
CHANGELOG=$(git log --pretty=oneline --first-parent $PREV..HEAD)
CHANGELOG="${CHANGELOG//'%'/'%25'}"
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
Expand Down

0 comments on commit 83f5102

Please sign in to comment.