I’m currently trying to make GitHub workflow work that, roughly spoke, does the following:
- Install a python dependency and fire up one of its commands
- This command, besides other things, tries to push changes (changes to this repo like adding a file for example) made in the workflow to the repo containing this workflow.
(Side note: Im using this from within a python project and pushing the changes via API calls).
Everything works fine (even running the same code locally executes successfully) but when it comes to pushing changes to the spoken repo from the workflow I run into the following error:
PullRequestException: Could not push MYBRANCH branch: Cmd('git') failed due to: exit code(1) cmdline: git push stderr: 'To https://github.com/Imipenem/Bertman ! [remote rejected] TEMPLATE -> TEMPLATE (refusing to allow a GitHub App to create or update workflow `.github/workflows/sync_project.yml` without `workflows` permission) error: failed to push some refs to 'https://github.com/Imipenem/Bertman''
The main point here seems to be the following:
refusing to allow a GitHub App to create or update workflow .github/workflows/sync_project.yml without workflows permission
I use a personal access token to make the API calls which has at least the workflows and repo scope enabled.
So I really dont know why it refuses to push the changes?
May I have to explicitely exclude the
.github/workflows/sync_project.yml from the push, as it should not get updated from within this workflow?
Or are there any other restrictions Im not aware of?
Many thanks in advance
EDIT: I solved the issue by removing the file temporarily! However, I’m curious why the above happened!