I have a GitHub Action workflow to create a new version and publish after merge to our master branch .However, master branch has a protection.1 solution that was tested successfully was to create PAT with admin permission then use that instead of the generated token by GitHub Action with limited permission, uncheck the "include administrators" on the branch protection rule. We don't want to uncheck the "include administrators" on the branch protection rule. please is there a way to solve this issue without changing anything on branch protection rules for your our master branch. thanks inadvance guys!!
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- name: Changelog Actions
id: changelog
uses: TriPSs/conventional-changelog-action@v3
with:
github-token: ${{ secrets.PAT_ACCESS }}
- name: create releases
uses: actions/create-release@v1
if: ${{ steps.changelog.outputs.skipped == 'false'}}
env:
GITHUB_TOKEN: ${{ secrets.PAT_ACCESS }}
with:
tag_name: ${{ steps.changelog.outputs.tag }}
release_name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
Error message generated when run with "include administrators" branch protection rule in place
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.