mirror of
https://github.com/Llewellynvdm/starship.git
synced 2024-12-26 03:27:30 +00:00
ci: Automate changelog generation
This commit is contained in:
parent
88e26f578d
commit
f5af004d3d
35
.github/workflows/generate-changelog.yml
vendored
Normal file
35
.github/workflows/generate-changelog.yml
vendored
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user