Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / .github / workflows / backport.yml
blob9343e29d5963314b99041ce5312b4960de4397af
1 name: Backport
2 on:
3   pull_request_target:
4     types: [closed, labeled]
6 # WARNING:
7 # When extending this action, be aware that $GITHUB_TOKEN allows write access to
8 # the GitHub repository. This means that it should not evaluate user input in a
9 # way that allows code injection.
11 permissions:
12   contents: read
14 jobs:
15   backport:
16     permissions:
17       contents: write # for korthout/backport-action to create branch
18       pull-requests: write # for korthout/backport-action to create PR to backport
19     name: Backport Pull Request
20     if: github.repository_owner == 'NixOS' && github.event.pull_request.merged == true && (github.event_name != 'labeled' || startsWith('backport', github.event.label.name))
21     runs-on: ubuntu-latest
22     steps:
23       - uses: actions/checkout@v4
24         with:
25           ref: ${{ github.event.pull_request.head.sha }}
26       - name: Create backport PRs
27         uses: korthout/backport-action@v2.1.1
28         with:
29           # Config README: https://github.com/korthout/backport-action#backport-action
30           copy_labels_pattern: 'severity:\ssecurity'
31           pull_description: |-
32             Bot-based backport to `${target_branch}`, triggered by a label in #${pull_number}.
34             * [ ] Before merging, ensure that this backport is [acceptable for the release](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#changes-acceptable-for-releases).
35               * Even as a non-commiter, if you find that it is not acceptable, leave a comment.