File: backport.yml

package info (click to toggle)
dnf5 5.4.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 17,960 kB
  • sloc: cpp: 94,312; python: 3,370; xml: 1,073; ruby: 600; sql: 250; ansic: 232; sh: 104; perl: 62; makefile: 30
file content (34 lines) | stat: -rw-r--r-- 1,250 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# 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 }}