# Inspired by: # Nixpkgs: https://github.com/NixOS/nixpkgs/blob/a698ac1214cd924d4394ca9cd2691618765aa03c/.github/workflows/backport.yml # NixOS-WSL: https://github.com/nix-community/NixOS-WSL/blob/be894604b2aa2184c0b3d3b44995acd0da14dc0c/.github/workflows/on_label.yml name: "Backport" on: pull_request_target: types: - closed - labeled jobs: backport: if: github.event.pull_request.labels && contains(join(github.event.pull_request.labels.*.name, ', '), 'backport ') name: Backport PR 🔙 runs-on: ubuntu-24.04 permissions: contents: write pull-requests: write outputs: created_pull_numbers: ${{ steps.backport.outputs.created_pull_numbers }} steps: - name: Check actor permissions id: check-permissions uses: prince-chrismc/check-actor-permissions-action@v3.0.2 with: permission: write - name: Generate App Token id: app-token uses: actions/create-github-app-token@v1 with: app-id: ${{ secrets.BACKPORT_APP_ID }} private-key: ${{ secrets.BACKPORT_APP_PRIVATE_KEY }} - name: Checkout uses: actions/checkout@v6 - name: Create backport PR id: backport uses: korthout/backport-action@v4.5.1 with: github_token: ${{ steps.app-token.outputs.token }} merge_commits: "skip" add_author_as_assignee: true copy_requested_reviewers: true experimental: >- { "conflict_resolution": "draft_commit_conflicts" }