nvf/.github/workflows/backport.yml
dependabot[bot] 940e3f1ca5
build(deps): bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-12 02:01:35 +00:00

33 lines
1.1 KiB
YAML

name: Backport PR on Label
on:
pull_request_target:
types:
- labeled
# Permissions needed for the korthout/backport-action to create branches and PRs
permissions:
contents: write
pull-requests: write
jobs:
backport:
name: Create Backport PR
runs-on: ubuntu-latest
if: |
github.event.pull_request.merged == true && startsWith(github.event.label.name, 'backport-')
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha }}
token: ${{ steps.app-token.outputs.token }}
- name: Backport Action
uses: korthout/backport-action@v3
with:
# Regex pattern for labels that should trigger a backport AND extracts the target branch
# from the name (e.g. v0.x or v0.x.y; we use zerover). This action will ONLY proceed if
# the label that triggered the workflow fully matches this pattern.
# Example matching labels: "backport-v0.1", "backport-v0.10.1"
# Example non-matching labels: "backport-foo", "backport-v1.0"
label_pattern: '^backport-(v0\.\d+(\.\d+)?)$'