It looks like this package doesn't take protected branches into account yet #48
Replies: 3 comments 2 replies
-
Getting an error when I try to implement. My research tells me that GitHub Apps are the recommended way to go, but I have little experience with those. |
Beta Was this translation helpful? Give feedback.
-
I was able to get this to work by creating a Fine Grained Token and setting Contents (Repository Permissions) to Read & Write. Nothing else is needed other than adding the resulting token to my repository's secrets ( name: "Update Changelog"
on:
release:
types: [released]
permissions:
contents: write
jobs:
update:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: main
token: ${{ secrets.PAT }}
- name: Update Changelog
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ github.event.release.name }}
release-notes: ${{ github.event.release.body }}
- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: main
commit_message: Update CHANGELOG
file_pattern: CHANGELOG.md I hope this added information helps anyone struggling with this problem. |
Beta Was this translation helpful? Give feedback.
-
If you have a ruleset which prevents direct contributions to main (i.e., not via pull request), then the action will fail, telling you:
According to https://stackoverflow.com/questions/69263843/how-to-push-to-protected-main-branches-in-a-github-action, you can create a deploy key and then run your action with it as a secret.
My current
update-changelog.yml
is written like this:If I add the secret, I'm hoping I will be able to keep my branch protection while the action bypasses it.
Beta Was this translation helpful? Give feedback.
All reactions