mirror of
https://github.com/neovim/neovim.git
synced 2026-05-25 22:38:29 +00:00
Problem: When auto-backport fails, it adds a `needs:backport` label. But that label isn't being used AFAIK, based on the fact there were 30+ old PRs with that label from last year (I have since cleaned those up). So the extra step of having to remove the label is unnecessary friction. In practice, when a manual backport is needed, it's best to either do it immediately or just remove the `backport-xx` label. Also, the presence of an unresolved "Failed backport" comment from the bot is already a kind of marker that indicates a backport is needed. Solution: Don't add `needs:backport` label on failed backport. Reverts https://github.com/neovim/neovim/pull/30363
42 lines
1.2 KiB
YAML
42 lines
1.2 KiB
YAML
name: backport
|
|
on:
|
|
pull_request_target:
|
|
types: [closed, labeled]
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
backport:
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
name: Backport Pull Request
|
|
if: github.event.pull_request.merged
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
persist-credentials: true
|
|
|
|
- uses: actions/create-github-app-token@v3
|
|
id: app-token
|
|
with:
|
|
app-id: ${{ vars.BACKPORT_APP }}
|
|
private-key: ${{ secrets.BACKPORT_KEY }}
|
|
|
|
- name: Create backport PR
|
|
id: backport
|
|
uses: korthout/backport-action@3c06f323a58619da1e8522229ebc8d5de2633e46 # v4.3.0
|
|
with:
|
|
pull_title: "backport: ${pull_title}"
|
|
label_pattern: "^ci:backport ([^ ]+)$"
|
|
github_token: ${{ steps.app-token.outputs.token }}
|
|
|
|
- name: Enable automerge
|
|
if: ${{ steps.backport.outputs.was_successful == 'true' }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
CREATED_PULL_NUMBERS: ${{ steps.backport.outputs.created_pull_numbers }}
|
|
run: |
|
|
gh pr merge --rebase --auto "${CREATED_PULL_NUMBERS}"
|