Skip to content

Release action not working under branch protection rules #38

@athril

Description

@athril

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions