-
Notifications
You must be signed in to change notification settings - Fork 357
65 lines (59 loc) · 2.04 KB
/
track-prs-for-release.yml
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
65
---
name: "Track PRs for release"
on: # yamllint disable-line rule:truthy
pull_request_target:
types:
- closed
- labeled
- unlabeled
branches:
- main
concurrency:
group: track-prs-for-release
env:
LOGS_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
# All jobs require a specifically generated token to run, since we want to
# access org-level projects and the normal GITHUB_TOKEN only has access to this
# repository.
jobs:
handle_merged_pr:
if: github.event.action == 'closed' && github.event.pull_request.merged
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.base_ref }}
- name: Generate token
id: generate_token
uses: tibdex/[email protected]
with:
app_id: ${{ secrets.RELEASE_APP_ID }}
private_key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
- name: Handle merged PR
env:
CASPER_TOKEN: ${{ secrets.CASPER_TOKEN }}
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
PR_ID: ${{ github.event.pull_request.node_id }}
run: tools/scripts/track-pr pr-merged "$PR_ID"
handle_labeled_pr:
if: github.event.action == 'labeled' || github.event.action == 'unlabeled'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.base_ref }}
- name: Generate token
id: generate_token
uses: tibdex/[email protected]
with:
app_id: ${{ secrets.RELEASE_APP_ID }}
private_key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
- name: Handle labeled PR
env:
CASPER_TOKEN: ${{ secrets.CASPER_TOKEN }}
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
PR_ID: ${{ github.event.pull_request.node_id }}
PR_LABEL: ${{ github.event.label.name }}
run: tools/scripts/track-pr pr-${{ github.event.action }} "$PR_ID" "$PR_LABEL"