Skip to content

Commit 4e6776b

Browse files
committed
Run the CI in the correct context
1 parent 8ebcf31 commit 4e6776b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/test_pr.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Test PR
22
on:
3-
pull_request: {}
3+
pull_request_target: {}
44

55
jobs:
66
test:
@@ -19,11 +19,14 @@ jobs:
1919
});
2020
2121
const packages = new Set();
22+
let bundlerChanges = false;
2223
files.forEach(file => {
2324
const match = file.filename.match(/^packages\/preview\/([^\/]+)\/([^\/]+)\//);
2425
if (match) {
2526
packages.add({ namespace: "preview", name: match[1], version: match[2] });
2627
}
28+
29+
bundlerChanges = bundlerChanges || file.filename.startsWith("bundler/");
2730
});
2831
2932
let sparseCheckoutPaths;
@@ -33,7 +36,10 @@ jobs:
3336
sparseCheckoutPaths = Array.from(packages).map((pkg) => `packages/preview/${pkg.name}/${pkg.version}/`).join('\n');
3437
}
3538
core.setOutput('sparse-checkout-paths', sparseCheckoutPaths);
36-
39+
core.setOutput('bundler-changes', bundlerChanges);
40+
- name: Require approval for bundler changes
41+
if: ${{ steps.extract-package.outputs.bundler-changes && ! contains(github.event.pull_request.labels.*.name, 'safe-bundler-changes') }}
42+
run: echo "The changes made to the bundler needs to be approved first." && false
3743
- uses: actions/checkout@v4
3844
with:
3945
sparse-checkout: |

0 commit comments

Comments
 (0)