Skip to content

Commit 240921d

Browse files
committed
ci(danger): split PR target ci workflows
1 parent 5429b2e commit 240921d

File tree

2 files changed

+39
-37
lines changed

2 files changed

+39
-37
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,13 @@ on:
1515
branches:
1616
- develop
1717

18-
# pull_request_target runs repo-owned checks (e.g., Danger comments) on the base ref with the base repo token;
19-
# never executes PR code.
20-
pull_request_target:
21-
branches:
22-
- develop
2318

2419
concurrency:
2520
group: ${{format('{0}:{1}', github.repository, github.ref)}}
2621
cancel-in-progress: true
2722

2823
jobs:
2924
cpp-matrix:
30-
if: github.event_name != 'pull_request_target'
3125
runs-on: ubuntu-24.04
3226
container:
3327
image: ubuntu:24.04
@@ -133,7 +127,6 @@ jobs:
133127
node .github/releases-matrix.js
134128
135129
build:
136-
if: github.event_name != 'pull_request_target'
137130
needs: cpp-matrix
138131

139132
strategy:
@@ -1319,33 +1312,3 @@ jobs:
13191312
llvm_dir="/var/www/mrdox.com/llvm+clang"
13201313
chmod 755 ${{ matrix.llvm-archive-filename }}
13211314
scp -o StrictHostKeyChecking=no $(pwd)/${{ matrix.llvm-archive-filename }} [email protected]:$llvm_dir/
1322-
1323-
repo-checks:
1324-
name: Repo checks
1325-
# Run under pull_request_target so we can use the base-repo token to comment on forked PRs
1326-
# without executing forked code in this job. Declared after the matrix job so the matrix stays first in the UI.
1327-
if: github.event_name == 'pull_request_target'
1328-
runs-on: ubuntu-24.04
1329-
permissions:
1330-
contents: read
1331-
pull-requests: write
1332-
issues: write
1333-
statuses: write
1334-
steps:
1335-
- name: Checkout base revision
1336-
uses: actions/checkout@v4
1337-
with:
1338-
fetch-depth: 0
1339-
1340-
- name: Setup Node.js
1341-
uses: actions/setup-node@v4
1342-
with:
1343-
node-version: 20
1344-
1345-
- name: Install repo-check tools
1346-
run: npm --prefix util/danger ci
1347-
1348-
- name: Repo checks (Danger)
1349-
env:
1350-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1351-
run: npx --prefix util/danger danger ci --dangerfile util/danger/dangerfile.ts
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: PR Target Checks
2+
3+
on:
4+
# Uses base-repo token and never executes PR code.
5+
pull_request_target:
6+
branches:
7+
- develop
8+
9+
concurrency:
10+
group: ${{ format('{0}:{1}:{2}', github.repository, github.ref, github.event_name) }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
repo-checks:
15+
name: Base-token checks
16+
runs-on: ubuntu-24.04
17+
permissions:
18+
contents: read
19+
pull-requests: write
20+
issues: write
21+
statuses: write
22+
steps:
23+
- name: Checkout base revision
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: 20
32+
33+
- name: Install repo-check tools
34+
run: npm --prefix util/danger ci
35+
36+
- name: Repo checks (Danger)
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
run: npx --prefix util/danger danger ci --dangerfile util/danger/dangerfile.ts

0 commit comments

Comments
 (0)