|
9 | 9 | permissions: {} |
10 | 10 |
|
11 | 11 | jobs: |
12 | | - backport_v1_0: |
13 | | - name: "Backport to v1.0" |
14 | | - permissions: |
15 | | - contents: read |
16 | | - pull-requests: write |
17 | | - # Only react to merged PRs for security reasons. |
18 | | - # See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target. |
19 | | - if: > |
20 | | - github.event.pull_request.merged |
21 | | - && ( |
22 | | - github.event.action == 'closed' |
23 | | - && contains(github.event.pull_request.labels.*.name, 'backport-v1.0') |
24 | | - || ( |
25 | | - github.event.action == 'labeled' |
26 | | - && contains(github.event.label.name, 'backport-v1.0') |
27 | | - ) |
28 | | - ) |
29 | | - runs-on: ubuntu-latest |
30 | | - steps: |
31 | | - - name: Generate a token from the orc-backport-bot github-app |
32 | | - id: generate_token |
33 | | - uses: getsentry/action-github-app-token@5c1e90706fe007857338ac1bfbd7a4177db2f789 # tag=v4.0.0 |
34 | | - with: |
35 | | - app_id: ${{ secrets.BACKPORT_APP_ID }} # zizmor: ignore[secrets-outside-env] |
36 | | - private_key: ${{ secrets.BACKPORT_APP_PRIVATE_KEY }} # zizmor: ignore[secrets-outside-env] |
37 | | - |
38 | | - - name: Backporting |
39 | | - if: > |
40 | | - contains(github.event.pull_request.labels.*.name, 'semver:patch') |
41 | | - || contains(github.event.label.name, 'semver:patch') |
42 | | - uses: kiegroup/git-backporting@08da0b07ef2330d189f6074ec8db736b3aa9f465 # tag=v4.9.1 |
43 | | - with: |
44 | | - target-branch: release-1.0 |
45 | | - pull-request: ${{ github.event.pull_request.url }} |
46 | | - auth: ${{ steps.generate_token.outputs.token }} |
47 | | - no-squash: true |
48 | | - strategy-option: find-renames |
49 | | - |
50 | | - - name: Report failure |
51 | | - if: failure() |
52 | | - run: gh issue comment "$NUMBER" --body "$BODY" |
53 | | - env: |
54 | | - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
55 | | - GH_REPO: ${{ github.repository }} |
56 | | - NUMBER: ${{ github.event.pull_request.number }} |
57 | | - BODY: > |
58 | | - Failed to backport PR to `release-1.0` branch. See [logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details. |
59 | | -
|
60 | | - - name: Report an error if backport unsupported labels |
61 | | - if: > |
62 | | - contains(github.event.pull_request.labels.*.name, 'semver:major') |
63 | | - || contains(github.event.pull_request.labels.*.name, 'semver:minor') |
64 | | - || contains(github.event.label.name, 'semver:major') |
65 | | - || contains(github.event.label.name, 'semver:minor') |
66 | | - run: gh pr comment "$NUMBER" --body "$BODY" |
67 | | - env: |
68 | | - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
69 | | - GH_REPO: ${{ github.repository }} |
70 | | - NUMBER: ${{ github.event.pull_request.number }} |
71 | | - BODY: > |
72 | | - Labels `semver:major` and `semver:minor` block backports to the branch `release-1.0`. |
73 | | -
|
74 | 12 | backport_v2_0: |
75 | 13 | name: "Backport to v2.0" |
76 | 14 | permissions: |
|
0 commit comments