-
-
Notifications
You must be signed in to change notification settings - Fork 70
64 lines (53 loc) · 2.35 KB
/
Copy pathcherry-pick-to-stable.yml
File metadata and controls
64 lines (53 loc) · 2.35 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Backport Merged Pull Requests
on:
pull_request_target:
types: [closed]
permissions: {}
jobs:
cherry-pick:
# Ensures the PR was actually merged AND has the correct backport label
if: |
github.event.pull_request.merged == true &&
contains(github.event.pull_request.labels.*.name, 'cherry-pick')
runs-on: ubuntu-slim
steps:
- name: Generate a GitHub App Token
id: generate-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3
with:
client-id: ${{ secrets.AURORABOT_APP_ID }}
private-key: ${{ secrets.AURORABOT_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Use the dynamically generated GitHub App token
token: ${{ steps.generate-token.outputs.token }}
# Explicitly check out the base branch (the PR is already merged into it).
# Avoids the default `refs/pull/<PR>/merge` ref, which actions/checkout
# refuses to check out for fork PRs on pull_request_target events.
ref: ${{ github.event.pull_request.base.ref }}
fetch-depth: 0
- name: Configure Git Author
run: |
git config --global user.name "Aurora-Backport[bot]"
git config --global user.email "aurora-backport[bot]@users.noreply.github.com"
- name: Create Backport Pull Requests
id: backport
uses: korthout/backport-action@2e830a1d0b8269505846ddd407a70876913ad1f8 # v4.6.0
with:
# Use the dynamically generated GitHub App token here too
github_token: ${{ steps.generate-token.outputs.token }}
target_branches: "stable-f44"
add_labels: "backported-to-stable"
pull_title: '${pull_title} [Backport ${target_branch}]'
pull_description: |
This is an automated backport of PR #${pull_number} to `${target_branch}`.
**_Please review the changes._**
### Original PR Description:
${pull_description}
- name: Fail if backport was unsuccessful
if: steps.backport.outputs.was_successful == 'false'
run: |
echo "::error::Backport PR creation failed (e.g. cherry-pick conflicts). Check the step above for details."
exit 1