arianacosta/poetic

Fix Publish Action

arianacosta opened this issue ยท 3 comments

Publish to NPM Action fails with

command: 'git push --tags https://x-access-token:[secure]@github.com/arianacosta/poetic.git HEAD:master',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: 'remote: error: GH006: Protected branch update failed for refs/heads/master.        \n' +
    'remote: error: At least 1 approving review is required by reviewers with write access.        \n' +
    'To https://github.com/arianacosta/poetic.git\n' +
    ' ! [remote rejected] HEAD -> master (protected branch hook declined)\n' +
    "error: failed to push some refs to 'https://x-access-token:[secure]@github.com/arianacosta/poetic.git'",
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false,
  pluginName: '@semantic-release/git'
}

How can we have automatic semantic releases while enforcing code reviews?

So the problem here is because of Github action has not rights (known issue) to push to protected branch (master).
Will create a workaround for this.

@arianacosta need some help from you if you don't mind:

  • generate a new Github token (settings -> secrets). Link for docs

Scopes for this token:

(enabled: read:packages, repo, write:packages)

  • add a new secret to the project with the name: "GITHUB_TOKEN_WORKAROUND" with generated in previous step token.

๐ŸŽ‰ This issue has been resolved in version 1.2.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€