|
| 1 | +# MANAGED FILE — do not edit on this fork. |
| 2 | +# |
| 3 | +# This workflow is generated by the `forward-port-distributor` workflow |
| 4 | +# in `ledoent/.github`. Any edits here will be overwritten on the next |
| 5 | +# run. To change behaviour, edit |
| 6 | +# ledoent/.github/.github/templates/forward-port.yml |
| 7 | +# and re-run the distributor (workflow_dispatch is fine). |
| 8 | +# |
| 9 | +# What it does: when a fork-internal PR is merged with a label of the |
| 10 | +# form `port:<branch>` (e.g. `port:19.0`), it cherry-picks the squash |
| 11 | +# commit onto `<branch>` and opens a follow-up PR. Conflicts are |
| 12 | +# reported in the PR body for manual resolution. |
| 13 | +# |
| 14 | +# Why it lives on every opted-in fork: the action triggers on |
| 15 | +# `pull_request: types: closed` on the host repo, so the workflow file |
| 16 | +# must exist there. |
| 17 | + |
| 18 | +name: forward-port |
| 19 | + |
| 20 | +on: |
| 21 | + pull_request_target: |
| 22 | + types: [closed] |
| 23 | + |
| 24 | +permissions: |
| 25 | + contents: write |
| 26 | + pull-requests: write |
| 27 | + |
| 28 | +jobs: |
| 29 | + forward-port: |
| 30 | + if: github.event.pull_request.merged == true |
| 31 | + runs-on: ubuntu-latest |
| 32 | + steps: |
| 33 | + - uses: actions/checkout@v4 |
| 34 | + with: |
| 35 | + fetch-depth: 0 |
| 36 | + - name: Cherry-pick to labelled branches |
| 37 | + uses: korthout/backport-action@v3 |
| 38 | + with: |
| 39 | + # Label format: `port:19.0` → forward-port to branch 19.0. |
| 40 | + # The action calls these "backport" but mechanically it's |
| 41 | + # identical to forward-porting. |
| 42 | + label_pattern: '^port:(?<target>.+)$' |
| 43 | + pull_title: '[FP from #${pull_number}] ${pull_title}' |
| 44 | + pull_description: | |
| 45 | + Forward-port of #${pull_number} to `${target_branch}`. |
| 46 | +
|
| 47 | + **Conflicts to resolve** (if any) are listed below. Once the |
| 48 | + branch is clean, mark this PR ready for review. |
| 49 | +
|
| 50 | + Original PR: #${pull_number} |
| 51 | + Trigger: label `port:${target_branch}` on the merged PR. |
| 52 | + merge_commits: skip |
0 commit comments