Skip to content

Commit

Permalink
Stop multipe changelog generators from crashing into each other
Browse files Browse the repository at this point in the history
  • Loading branch information
wren committed Feb 9, 2020
1 parent d495f6f commit efa1aac
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .build/generate_changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ fi
git config --global user.email "jrnl.bot@gmail.com"
git config --global user.name "Jrnl Bot"
git checkout $BRANCH
git pull origin $BRANCH

# Check if branch has been updated since this build started
# This tends to happen if multiple things have been merged in at the same time.
if [[ $(git rev-parse head) != $TRAVIS_COMMIT ]]; then
echo "${BRANCH} has been updated since build started. Aborting changelog."
exit 0
fi

git add "$FILENAME"
git commit -m "Updating changelog [ci skip]"
git push https://${GITHUB_TOKEN}@github.com/jrnl-org/jrnl.git $BRANCH
Expand Down

0 comments on commit efa1aac

Please sign in to comment.