update generate-changelog to add permissions for commit #8
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: Generate Changelog | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
changelog: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
token: ${{ secrets.CHANGELOG_GITHUB_TOKEN }} | |
- name: Generate Changelog | |
run: | | |
export PATH="$PATH:/home/runner/.local/share/gem/ruby/3.0.0/bin" | |
gem install --user-install github_changelog_generator | |
github_changelog_generator \ | |
-u ${{ github.repository_owner }} \ | |
-p ${{ github.event.repository.name }} \ | |
--token ${{ secrets.CHANGELOG_GITHUB_TOKEN }} | |
- name: Checkout to branch | |
run: | | |
git checkout "${GITHUB_REF#refs/heads/}" | |
- name: Commit Changelog | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "chore: update changelog" | |
branch: ${{ github.head_ref || github.ref_name }} | |
file_pattern: "CHANGELOG.md" | |
commit_author: "GitHub Action <[email protected]>" |