1+ # This workflow will attempt to port a merged pull request to
2+ # the branch specified in a "port to" label (if exists)
3+ name : Port merged Pull Request
4+
5+ # Only run for merged PRs against the "main" or maintenance branches
6+ # We allow this to run for `pull_request_target` so that github secrets are available
7+ # (This is required when the PR comes from a forked repo)
8+ on :
9+ pull_request_target :
10+ types : [ closed ]
11+ branches :
12+ - main
13+ - ' dspace-**'
14+
15+ permissions :
16+ contents : write # so action can add comments
17+ pull-requests : write # so action can create pull requests
18+
19+ jobs :
20+ port_pr :
21+ runs-on : ubuntu-latest
22+ # Don't run on closed *unmerged* pull requests
23+ if : github.event.pull_request.merged
24+ steps :
25+ # Checkout code
26+ - uses : actions/checkout@v3
27+ # Port PR to other branch (ONLY if labeled with "port to")
28+ # See https://github.com/korthout/backport-action
29+ - name : Create backport pull requests
30+ uses : korthout/backport-action@v1
31+ with :
32+ # Trigger based on a "port to [branch]" label on PR
33+ # (This label must specify the branch name to port to)
34+ label_pattern : ' ^port to ([^ ]+)$'
35+ # Title to add to the (newly created) port PR
36+ pull_title : ' [Port ${target_branch}] ${pull_title}'
37+ # Description to add to the (newly created) port PR
38+ pull_description : ' Port of #${pull_number} by @${pull_author} to `${target_branch}`.'
39+ # Copy all labels from original PR to (newly created) port PR
40+ # NOTE: The labels matching 'label_pattern' are automatically excluded
41+ copy_labels_pattern : ' .*'
42+ # Use a personal access token (PAT) to create PR as 'dspace-bot' user.
43+ # A PAT is required in order for the new PR to trigger its own actions (for CI checks)
44+ github_token : ${{ secrets.PR_PORT_TOKEN }}
0 commit comments