Skip to content

ci/backport: init #3411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Based on
# https://github.com/NixOS/nixpkgs/blob/2566f9dc/.github/workflows/backport.yml
name: Backport

on:
pull_request_target:
types:
- closed
- labeled

jobs:
backport:
name: Backport Pull Request
if: >
vars.CI_APP_ID
&& github.event.pull_request.merged == true
&& (
github.event.action != 'labeled'
|| startsWith(github.event.label.name, 'backport')
)

runs-on: ubuntu-24.04-arm
steps:
- name: Create GitHub App token
uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.CI_APP_ID }}
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}
permission-contents: write
permission-pull-requests: write

- uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
ref: ${{ github.event.pull_request.head.sha }}

- name: Create backport PRs
id: backport
uses: korthout/backport-action@v3
with:
# See https://github.com/korthout/backport-action#inputs
github_token: ${{ steps.app-token.outputs.token }}
branch_name: backport/${target_branch}/${pull_number}
copy_labels_pattern: .*