I have an action created so that, when a Pull Request is merged, it activates and cleans up the files and uploads them back to the main
branch. This is my action.yml
:
permissions:
contents: write
actions: read
on:
pull_request:
types: [closed]
branches:
- main
jobs:
archive-and-reset:
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'code/PH-')
runs-on: ubuntu-latest
name: Archive Experiment and Reset src
steps:
- name: Checkout
uses: actions/checkout@v4
- name: action execution
uses: myprivaterepo/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
For a few days this action has failed because it can’t push to the main branch:
0s
Run myprivaterepo/[email protected]
Error: Command failed: git push
remote: error: GH006: Protected branch update failed for refs/heads/main.
remote: error: Required status check "Archive Experiment and Reset src" is expected.
To https://github.com/myprivaterepo/repo-client-testing
! [remote rejected] main -> main (protected branch hook declined)
error: failed to push some refs to 'https://github.com/myprivaterepo/repo-client-testing'
Does anyone know if GitHub is protecting the main branch in a hidden way? I don’t have any Rulesets assigned to the main branch.