Skip to content

ci: enable merge groups #14

ci: enable merge groups

ci: enable merge groups #14

Workflow file for this run

name: Backport
on:
pull_request_target:
types:
- closed
- labeled
jobs:
backport:
name: Create backport
runs-on: ubuntu-latest
# This workflow only applies to merged PRs; and triggers on a PR being closed, or the backport label being applied.
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
if: >
github.event.pull_request.merged
&& (
(github.event.action == 'closed' && contains(github.event.pull_request.labels.*.name, 'backport/'))
||
(github.event.action == 'labeled' && contains(github.event.label.name, 'backport/')
)
)
steps:
- uses: actions/checkout@v4
# This workflow requires a non-GHA token in order to trigger downstream CI, and to access the 'fork' repository.
- id: app-token
uses: actions/create-github-app-token
with:
app-id: ${{ secrets.POETRY_TOKEN_APP_ID }}
private-key: ${{ secrets.POETRY_TOKEN_APP_KEY }}
- name: cherry-pick
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
set -euo pipefail
git config --global user.name "${{ steps.app-token.outputs.slug }}[bot]"
git config --global user.email "${{ steps.app-token.outputs.slug }}[bot]@users.noreply.github.com"
gh repo fork --remote-name fork
./.github/scripts/backport.sh --pr ${{ github.event.pull_request.number }} --comment --remote fork