Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release action not working under branch protection rules #38

Open
athril opened this issue Mar 12, 2024 · 0 comments
Open

Release action not working under branch protection rules #38

athril opened this issue Mar 12, 2024 · 0 comments

Comments

@athril
Copy link
Collaborator

athril commented Mar 12, 2024

In order to release a new version of the software, in the repository's Setting -> Branches -> main you need to uncheck the following options:

  • Require a pull request before merging
  • Restrict who can push to matching branches

Otherwise, the Release new version action (release.yml) will fail with the following error:

Error: To https://github.com/nih-sparc/sparc.client
!	refs/heads/main:refs/heads/main	[remote rejected] (protected branch hook declined)
Done
Pushing to https://github.com/nih-sparc/sparc.client
POST git-receive-pack (2445 bytes)
remote: error: GH006: Protected branch update failed for refs/heads/main.        
remote: error: Changes must be made through a pull request. You're not authorized to push to this branch. Visit https://docs.github.com/articles/about-protected-branches/ for more information.        
error: failed to push some refs to 'https://github.com/nih-sparc/sparc.client'

It may be the matter of changing permissions, or finding a workaround (launching an action that makes a pull requests and automatically approves it).

If the release action fails, please run git push --delete origin v0.3.0 (with proper version name) to remove tag from the repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant