diff --git a/.github/workflows/hotfix.yml b/.github/workflows/hotfix.yml new file mode 100644 index 00000000..c1d30414 --- /dev/null +++ b/.github/workflows/hotfix.yml @@ -0,0 +1,23 @@ +name: Bypass Branch Protection for Hotfix PRs + +on: + pull_request: + branches: + - develop + +jobs: + bypass-protection: + if: startsWith(github.event.pull_request.head.ref, 'hotfix/') + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Attempt Rebase and Merge Hotfix PR + run: | + gh pr merge ${{ github.event.pull_request.number }} --rebase --admin + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}