File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 2323 }
2424
2525 console.log('✅ PR title format is valid');
26+
27+ - name : Ensure PR Has a Nitro Companion
28+ uses : actions/github-script@v7
29+ with :
30+ script : |
31+ const prBody = github.event.pull_request.body;
32+
33+ if (!prBody) {
34+ core.setFailed("The PR description is empty. Please ensure it contains the required link.");
35+ return;
36+ }
37+
38+ // The required regex pattern:
39+ // 1. Matches the literal string "pulled in by https://github.com/OffchainLabs/nitro/pull/"
40+ // 2. Requires one or more digits (\d+) for the pull request number (xxxx)
41+ // 3. The 'i' flag makes the entire match case-insensitive (e.g., "Pulled In By" is valid)
42+ const requiredRegex = /pulled in by https:\/\/github\.com\/OffchainLabs\/nitro\/pull\/\d+/i;
43+
44+ if (!requiredRegex.test(prBody)) {
45+ core.setFailed(
46+ `PR description validation failed.
47+
48+ The description must contain a line matching the case-insensitive pattern:
49+ 'pulled in by https://github.com/OffchainLabs/nitro/pull/xxxx',
50+ where 'xxxx' is a number.`
51+ );
52+ } else {
53+ core.info("✅ PR description contains the required link.");
54+
You can’t perform that action at this time.
0 commit comments