Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop multiple changelog generators from crashing into each other #845

Merged
merged 2 commits into from
Feb 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions .build/generate_changelog.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
#!/usr/bin/env bash

BRANCH=$TRAVIS_BRANCH
if [[ $TRAVIS_BRANCH == $TRAVIS_TAG ]]; then
BRANCH='master'
fi

# 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 [[ -z $TRAVIS_TAG ]]; then
git fetch origin
if [[ $(git rev-parse "origin/${BRANCH}") != $TRAVIS_COMMIT ]]; then
echo "${BRANCH} has been updated since build started. Aborting changelog."
exit 0
fi
fi

FILENAME='CHANGELOG.md'

# get the latest git tags
Expand Down Expand Up @@ -40,11 +55,6 @@ docker run -it --rm -v "$(pwd)":/usr/local/src/your-app ferrarimarco/github-chan
# Put back our link (instead of the broken one)
sed -i 's!https://pypi.org/project/jrnl/HEAD/!https://github.com/jrnl-org/jrnl/!' "$FILENAME"

BRANCH=$TRAVIS_BRANCH
if [[ $TRAVIS_BRANCH == $TRAVIS_TAG ]]; then
BRANCH='master'
fi

git config --global user.email "jrnl.bot@gmail.com"
git config --global user.name "Jrnl Bot"
git checkout $BRANCH
Expand Down
6 changes: 0 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,8 @@ git:
depth: false
autocrlf: false

addons:
apt:
packages:
- tree

before_install:
- date
- tree

install:
- pip install poetry
Expand Down