I have two GitHub Actions in the same repo. I'm trying to update one from the other, but I get the following error when trying to commit and push the changes:
! [remote rejected] HEAD -> some-branch (refusing to allow a GitHub App to create or update workflow .github/workflows/the-other-action.yml without workflows permission)
This is a simplified version of the GH Action I'm trying to run:
name: my-action
on:
workflow_dispatch:
schedule:
- cron: "0 9 * * *"
jobs:
components:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Update the other Action
run: |
# Do something to .github/workflows/the-other-action.yaml here
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: some-branch
commit-message: Updated stuff
I'm trying to figure out how to give the workflows
permission to the GITHUB_TOKEN
, but not sure how to?
(For context: I'm running this action once per day to check if a new version of a tool used in the other action has been released. If so, it creates a PR updating the other action to use the newer version instead)