Fix Changelog Push Branch Target #12
Workflow file for this run
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
name: 'Update Changelog' | |
on: | |
pull_request: | |
types: [closed] | |
release: | |
types: [published] | |
permissions: | |
contents: write | |
jobs: | |
pull-request-update-changelog: | |
if: github.event_name == 'pull_request' || github.event.pull_request.merged == true | |
name: "Update Changelog" | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Generate Token' | |
uses: actions/create-github-app-token@v1 | |
id: token-generator | |
with: | |
app-id: ${{ secrets.TOKEN_GENERATOR_APP_ID }} | |
private-key: ${{ secrets.TOKEN_GENERATOR_PRIVATE_KEY }} | |
- name: 'Checkout Branch' | |
uses: actions/checkout@v4 | |
with: | |
ref: master | |
fetch-depth: 0 | |
token: ${{ steps.token-generator.outputs.token }} | |
- name: 'Initialize Environment' | |
uses: ./.github/actions/initialize-environment | |
- name: 'Generate Changelog' | |
run: | | |
make generate_changelog | |
- name: 'Push Changes' | |
if: success() | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: 'Update Changelog (!automated)' | |
branch: master | |
release-update-changelog: | |
if: github.event_name == 'release' | |
name: "Update Changelog (Release)" | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Generate Token' | |
uses: actions/create-github-app-token@v1 | |
id: token-generator | |
with: | |
app-id: ${{ secrets.TOKEN_GENERATOR_APP_ID }} | |
private-key: ${{ secrets.TOKEN_GENERATOR_PRIVATE_KEY }} | |
- name: 'Checkout Branch' | |
uses: actions/checkout@v4 | |
with: | |
ref: master | |
fetch-depth: 0 | |
token: ${{ steps.token-generator.outputs.token }} | |
- name: 'Initialize Environment' | |
uses: ./.github/actions/initialize-environment | |
- name: 'Generate Changelog' | |
run: | | |
make generate_changelog | |
- name: 'Push Changes' | |
if: success() | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: 'Update Changelog (!automated)' | |
branch: master | |
- name: 'Retag Release' | |
if: success() | |
uses: EndBug/latest-tag@latest | |
with: | |
ref: ${{ github.event.release.tag_name }} |