summaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorMatan Kushner <hello@matchai.dev>2020-01-20 12:00:38 -0500
committerMatan Kushner <hello@matchai.dev>2020-01-20 12:00:38 -0500
commitf5af004d3d54ca2edc9e324311b51177539339ce (patch)
tree7424e9ed3d44c420015e2055232cdf6b836b34fc /.github
parent88e26f578d8c773113d8f3f0719c6c10668d0aa3 (diff)
ci: Automate changelog generation
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/generate-changelog.yml35
1 files changed, 35 insertions, 0 deletions
diff --git a/.github/workflows/generate-changelog.yml b/.github/workflows/generate-changelog.yml
new file mode 100644
index 000000000..06d17a294
--- /dev/null
+++ b/.github/workflows/generate-changelog.yml
@@ -0,0 +1,35 @@
+name: Generate changelog
+on:
+ push:
+ branches:
+ - master
+
+jobs:
+ # Generate a changelog
+ changelog:
+ name: Generate CHANGELOG.md
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Generate changelog file
+ run: |
+ # Temporary fix for https://github.com/actions/setup-go/issues/14
+ export PATH=$PATH:$(go env GOPATH)/bin
+ go get -u github.com/git-chglog/git-chglog/cmd/git-chglog
+ git-chglog -c .github/chglog/changelog.yml > CHANGELOG.md
+
+ - name: Push to GitHub
+ run: |
+ remote_repo="https://starship-bot:${CHANGELOG_GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
+ git config user.name "Starship Bot"
+ git config user.email "bot@starship.rs"
+ git remote add publisher "${remote_repo}"
+ git show-ref # useful for debugging
+ git branch --verbose
+
+ git checkout master
+ git add -A
+ git commit -m "Update CHANGELOG.md [${GITHUB_SHA}]"
+ git pull --rebase publisher master
+ git push publisher master