Last active
July 17, 2020 03:59
-
-
Save webpapaya/65651d31f538dbe3f64a65e7b77de551 to your computer and use it in GitHub Desktop.
Travis CHANGELOG.md generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "$CHANGELOG_BRANCH" ]; then | |
echo "This commit was made against the $TRAVIS_BRANCH and not $CHANGELOG_BRANCH! Changelog not updated!" | |
exit 0 | |
fi | |
gem install rack -v 1.6.4 | |
gem install github_changelog_generator | |
rev=$(git rev-parse --short HEAD) | |
CHANGELOG_EMAIL=${CHANGELOG_EMAIL:='travis@github.com'} | |
git config user.name "Travis CI" | |
git config user.email $CHANGELOG_EMAIL | |
CHANGELOG_BRANCH=${CHANGELOG_BRANCH:='master'} | |
git remote add upstream "https://$GITHUB_TOKEN@github.com/$TRAVIS_REPO_SLUG.git" | |
git fetch upstream | |
git checkout $CHANGELOG_BRANCH | |
github_changelog_generator | |
git add -A CHANGELOG.md | |
git commit -m "updated changelog at ${rev}" | |
git push upstream $CHANGELOG_BRANCH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: node_js | |
node_js: | |
- '6.3' | |
cache: | |
directories: | |
- node_modules | |
after_success: | |
- curl https://gist.githubusercontent.com/webPapaya/65651d31f538dbe3f64a65e7b77de551/raw/deploy-changelog.sh > deploy-changelog.sh && chmod u+x deploy-changelog.sh && ./deploy-changelog.sh; | |
env: | |
global: | |
- CHANGELOG_BRANCH=master | |
- secure: <YOUR ENCRYPTED $GITHUB_TOKEN> | |
- secure: <YOUR ENCRYPTED $CHANGELOG_GITHUB_TOKEN> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment