Give workflow suitable permissions to push to master
See original GitHub issueThe workflow console looks perfect, seems like everything had worked as it should. However, the GitHub actions token has no suitable permission to push torwards master. It seems we need to adapt the repository config to make the workflow run successful…
In the GitHub support community forum, it was suggested to create a new secret inside the repository settings. (…/settings/secrets). Then we can use it inside the workflow file:
${{ secrets.GITHUB_TOKEN_OURS }}
https://github.community/t/how-to-push-to-protected-branches-in-a-github-action/16101/23
Merge made by the 'recursive' strategy.
main/src/cgeo/geocaching/utils/SystemInformation.java | 2 ++
1 file changed, 2 insertions(+)
remote: error: GH006: Protected branch update failed for refs/heads/master.
remote: error: You're not authorized to push to this branch. Visit https://docs.github.com/articles/about-protected-branches/ for more information.
To https://github.com/cgeo/cgeo.git
! [remote rejected] master -> master (protected branch hook declined)
error: failed to push some refs to 'https://github.com/cgeo/cgeo.git'
Error: Process completed with exit code 1.
_Originally posted by @fm-sys in https://github.com/cgeo/cgeo/issues/11733#issuecomment-927311590_
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (13 by maintainers)
Top Results From Across the Web
How GitLab Permissions and Protected Branches Keep Your ...
By basing permissions on simple principles and adding protected branches, GitLab allows you to set up any type of workflow, while protecting ...
Read more >remote: Permission to git denied to github-actions[bot]. #96
Run ad-m/github-push-action@master with: github_token: *** branch: ... Setting up permission in a workflow can potentially solve the problem, but it's worth ...
Read more >Using branch permissions | Bitbucket Data Center and Server ...
Branch permissions provide another level of security in Bitbucket, with user authentication and project, repository and global permissions, that together ...
Read more >Prevent pushing to master on GitHub? - Stack Overflow
Since the original question / answer, Github has added a new option for this to the restricted branches UI which allows you to...
Read more >Git branch policies and settings - Azure Repos - Microsoft Learn
To set branch policies, you must be a member of the Project Administrators security group or have repository-level Edit policies permissions.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was wrong, tested it and it seems to work now…Hurray! Need to check the result though.
What would happen if the merge results in conflicts…would it abort?
Thanks @fm-sys for implementing the workflow. Seems to work fine!!!