diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml new file mode 100644 index 0000000..96dbd8d --- /dev/null +++ b/.github/workflows/backport.yml @@ -0,0 +1,28 @@ +name: Backport + +on: + pull_request_target: + types: [closed] + # See also commands.yml for the /backport triggered variant of this workflow. + +permissions: + contents: read + +jobs: + open-pr: + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-24.04 + if: github.event.pull_request.merged + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + fetch-depth: 0 + + - name: Open Backport PR + uses: korthout/backport-action@4aaf0e03a94ff0a619c9a511b61aeb42adea5b02 # v4.2.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + github_workspace: ${{ github.workspace }} diff --git a/.github/workflows/commands.yml b/.github/workflows/commands.yml new file mode 100644 index 0000000..5e52815 --- /dev/null +++ b/.github/workflows/commands.yml @@ -0,0 +1,38 @@ +name: Comment Commands + +on: issue_comment + +permissions: + contents: read + +jobs: + # See also backport.yml, which is the variant that triggers on PR merge rather + # than on comment. + backport: + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-24.04 + if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/backport') + steps: + - name: Extract Command + id: command + uses: xt0rted/slash-command-action@bf51f8f5f4ea3d58abc7eca58f77104182b23e88 # v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + command: backport + reaction: "true" + reaction-type: "eyes" + allow-edits: "false" + permission-level: write + + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + fetch-depth: 0 + + - name: Open Backport PR + uses: korthout/backport-action@4aaf0e03a94ff0a619c9a511b61aeb42adea5b02 # v4.2.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + github_workspace: ${{ github.workspace }}