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.

Protected Branches

See original GitHub issue

Hey cool action here. 😃

I’ve used it without problem until now… doing an actual release, of course. 😆

The problem is that our repo has protected branch rules, and is getting an error when push occurs:

https://github.com/ExtendedXmlSerializer/home/runs/330624066

(Under Push Changes)

Started: bash /home/runner/work/_actions/ad-m/github-push-action/master/start.sh
Push to branch master
remote: error: GH006: Protected branch update failed for refs/heads/master.        
remote: error: Required status check "continuous-integration/appveyor/pr" is expected.        
To https://github.com/ExtendedXmlSerializer/home.git
 ! [remote rejected]   HEAD -> master (protected branch hook declined)
error: failed to push some refs to '***github.com/ExtendedXmlSerializer/home.git'

Here is our configuration: https://github.com/ExtendedXmlSerializer/home/blob/47f7567de9a45f849ffa106bd391d11026b8a2eb/.github/workflows/publish-release-build.yml#L49-L52

The thought to set force: true strikes me, but I am not sure that this will fix the problem. The other issue is that I do not want to do a force push from CI as this seems to be asking for more trouble. 😅

I thought secrets.GITHUB_TOKEN had administrator privileges but that does not appear to be the case. Is there another setting to consider here? Any suggestions/guidance would be greatly appreciated.

I am going to turn off branch protections for now and in the meantime so I can get this sucker deployed.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
Mike-E-angelocommented, Dec 3, 2019

Hey all, I am going to close this issue as I think I have a solution to the primary problem, thanks to @tenhobi’s lead.

The plan is to :

There is a bug still but I think it should be in its own issue. I will create that now for better visibility.

0reactions
Mike-E-angelocommented, Dec 3, 2019

Cool thank you both for your insight and assistance!

@tenhobi thank you for that share. Glad to see I am not the only person experiencing this. If I understand correctly, I basically either turn off branch protection like I do now (not preferred) or I have to switch to generating PRs which I then manually accept.

This is actually not a bad strategy as it is what I first thought of when I first started working with GitHub Actions. 😁 I am also looking into building my own Probot app to help smooth out some other deficiencies I have encountered. Maybe I will see about attending to this one as well if I cannot use one of the solutions provided in your share.

As for Personal Access Tokens, I am familiar with them @ad-m, but am very concerned with their security implications as they are not scoped per-repository like GitHub Apps are. I would like to stay away from those if possible.

Also, I did do a search for when but did not find anything obvious. Apologies. Did you mean if by chance? If not, do you happen to have a resource on this? I will check it out. Still learning GitHub Actions a lot. 😃

Thank you both again for your assistance and for building something cool here!

Read more comments on GitHub >

github_iconTop Results From Across the Web

About protected branches - GitHub Docs
You can protect important branches by setting branch protection rules, which define whether collaborators can delete or force push to the branch and...
Read more >
Protected branches - GitLab Docs
Configure a protected branch · On the top bar, select Main menu > Projects and find your project. · On the left sidebar,...
Read more >
What is protected git branch? - Stack Overflow
Protected branches ensure that collaborators on your repository cannot make irrevocable changes to branches. These branches can also be ...
Read more >
Protected branches · Project · User · Help · GitLab - ETSI Forge
Go to your project and select Settings > Repository. Expand Protected branches. From the Branch dropdown menu, select the branch you want to...
Read more >
How to set up Git branch protection rules - Spectral
Learn how to set up git branch protection for GitHub, GitLab, and Bitbucket to protect your code quality and security.
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