semantic-release / github

:octocat: semantic-release plugin to publish a GitHub release and comment on released Pull Requests/Issues
MIT License
402 stars 125 forks source link

Protected branch with PR requirement prevents release #175

Closed Ninerian closed 5 years ago

Ninerian commented 5 years ago

Hello we integrated semantic release in our tool chain, but as we tried to release to master the first time, the branch protection of master prevented the release.

The error message from travis:

[9:32:50 AM] [semantic-release] › ✖  An error occurred while running semantic-release: { Error: Command failed: git push --tags https://[secure]@github.com/**/service.git HEAD:master
remote: error: GH006: Protected branch update failed for refs/heads/master.        
remote: error: At least 1 approving review is required by reviewers with write access.        
To https://github.com/**/service.git
 ! [remote rejected] HEAD -> master (protected branch hook declined)
error: failed to push some refs to 'https://[secure]@github.com/**/service.git'

How could I keep the PR rule and enable semantic release?

travi commented 8 months ago

To cover the most common reasons folks choose to make commits during a release, the recommended approach is to use GitHub releases (or similar) for release notes rather than updating a changelog file and rely on the registry when determining the latest version rather than updating the version in the package.json file. Avoid making a commit altogether for those sorts of details.

Not recommending making the updates manually. If you decide you still want those changes as part of a release, let semantic-release automate them for you, but know that having a commit adds significant complexity that you could avoid.

cloverink commented 4 months ago
      - name: 👾 Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
          persist-credentials: false