Protected Branches
See original GitHub issueHey 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:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
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 :
automerge
.automerge
. 😁 https://github.com/pascalgn/automerge-actionThere is a bug still but I think it should be in its own issue. I will create that now for better visibility.
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 meanif
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!