dnf5/.github/workflows/backport.yml

35 lines
1.2 KiB
YAML

# Based on https://github.com/NixOS/nixpkgs/blob/master/.github/workflows/backport.yml
name: Backport merged pull requests
on:
pull_request_target:
types: [closed, labeled]
permissions: {}
jobs:
backport:
name: Backport pull request
if: github.repository_owner == 'rpm-software-management' && github.event.pull_request.merged == true && (github.event_name != 'labeled' || startsWith('backport', github.event.label.name))
runs-on: ubuntu-latest
steps:
# Use a GitHub App to create the PR so that CI gets triggered
# The App is scoped to Repository > Contents and Pull Requests: write
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.RSM_CI_APP_ID }}
private-key: ${{ secrets.RSM_CI_APP_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
token: ${{ steps.app-token.outputs.token }}
- name: Create backport PRs
uses: korthout/backport-action@v3
with:
# Config README: https://github.com/korthout/backport-action#backport-action
add_author_as_assignee: true
github_token: ${{ steps.app-token.outputs.token }}