robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
aa1d8a2702
master
1name : backport 2on : 3pull_request_target : 4types : [ closed , labeled ] 5 6permissions : {} 7 8jobs : 9backport : 10permissions : 11contents : write 12pull-requests : write 13name : Backport Pull Request 14if : github.event.pull_request.merged 15runs-on : ubuntu-latest 16steps : 17- uses : actions/checkout@v7.0.1 18with : 19persist-credentials : true 20# Check out the merged-into base branch by name. Without an explicit 21# ref, checkout resolves to the base tip SHA, which for a _merged_ PR 22# equals pull_request.merge_commit_sha and trips the 23# actions/checkout@v7.0.1 `allow-unsafe-pr-checkout` guard (false 24# positive: this is trusted base code, not fork PR code). 25ref : ${{ github.event.pull_request.base.ref }} 26 27- uses : actions/create-github-app-token@v3.2.0 28id : app-token 29with : 30app-id : ${{ vars.BACKPORT_APP }} 31private-key : ${{ secrets.BACKPORT_KEY }} 32 33- name : Create backport PR 34id : backport 35uses : korthout/backport-action@6b65649031ac6d18ffdfd0c0820e9436f3fde22b # v4.6.1 36with : 37pull_title : "backport: ${pull_title}" 38label_pattern : "^ci:backport ([^ ]+)$" 39github_token : ${{ steps.app-token.outputs.token }} 40 41- name : Enable automerge 42if : ${{ steps.backport.outputs.was_successful == 'true' }} 43env : 44GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} 45CREATED_PULL_NUMBERS : ${{ steps.backport.outputs.created_pull_numbers }} 46run : | 47 gh pr merge --rebase --auto "${CREATED_PULL_NUMBERS}"