|
7 | 7 | - completed
|
8 | 8 |
|
9 | 9 | permissions:
|
| 10 | + actions: read |
10 | 11 | contents: read
|
11 | 12 |
|
12 |
| -concurrency: |
13 |
| - # Ideally, we would use the PR number in the concurrency group, but we don't |
14 |
| - # have access to it here. We need to ensure only one job is running for |
15 |
| - # each PR at a time, because there is a potential race condition when |
16 |
| - # updating the issue comment. |
17 |
| - group: "PR Subscriber" |
18 |
| - cancel-in-progress: false |
19 |
| - |
20 | 13 | jobs:
|
21 | 14 | auto-subscribe:
|
22 | 15 | runs-on: ubuntu-latest
|
|
25 | 18 | github.event.workflow_run.event == 'pull_request' &&
|
26 | 19 | github.event.workflow_run.conclusion == 'success'
|
27 | 20 | steps:
|
| 21 | + - name: Setup Automation Script |
| 22 | + run: | |
| 23 | + curl -O -L https://raw.githubusercontent.com/"$GITHUB_REPOSITORY"/main/llvm/utils/git/github-automation.py |
| 24 | + curl -O -L https://raw.githubusercontent.com/"$GITHUB_REPOSITORY"/main/llvm/utils/git/requirements.txt |
| 25 | + curl -O -L https://raw.githubusercontent.com/"$GITHUB_REPOSITORY"/main/.github/workflows/pr-subscriber-wait.py |
| 26 | + chmod a+x github-automation.py |
| 27 | + pip install -r requirements.txt |
| 28 | +
|
| 29 | + - name: 'Wait for other actions' |
| 30 | + # We can't use the concurrency tag for these jobs, because it will |
| 31 | + # cancel pending jobs if another job is running. |
| 32 | + env: |
| 33 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 34 | + run: | |
| 35 | + python3 pr-subscriber-wait.py |
| 36 | +
|
| 37 | +
|
28 | 38 | # From: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
|
29 | 39 | # Updated version here: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow
|
30 | 40 | - name: 'Download artifact'
|
|
50 | 60 |
|
51 | 61 | - run: unzip pr.zip
|
52 | 62 |
|
53 |
| - - name: Setup Automation Script |
54 |
| - run: | |
55 |
| - curl -O -L https://raw.githubusercontent.com/"$GITHUB_REPOSITORY"/main/llvm/utils/git/github-automation.py |
56 |
| - curl -O -L https://raw.githubusercontent.com/"$GITHUB_REPOSITORY"/main/llvm/utils/git/requirements.txt |
57 |
| - chmod a+x github-automation.py |
58 |
| - pip install -r requirements.txt |
59 |
| -
|
60 | 63 | - name: Update watchers
|
61 | 64 | # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
|
62 | 65 | run: |
|
|
0 commit comments