question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Give workflow suitable permissions to push to master

See original GitHub issue

The 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:closed
  • Created 2 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
Lineflyercommented, Sep 29, 2021

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?

0reactions
Lineflyercommented, Sep 29, 2021

Thanks @fm-sys for implementing the workflow. Seems to work fine!!!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found