Skip to content

Commit f06f3ef

Browse files
authored
Merge branch 'main' into dustin/engine_playground
2 parents 7ab9e20 + 0e98b09 commit f06f3ef

File tree

2 files changed

+36
-26
lines changed

2 files changed

+36
-26
lines changed

.github/workflows/issue.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Linked Issue
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited]
6+
7+
env:
8+
VALID_ISSUE_PREFIXES: "CNCT|DASH"
9+
10+
jobs:
11+
linear:
12+
name: Linear
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Check for linked issue
16+
uses: actions/github-script@v7
17+
with:
18+
script: |
19+
const pr = await github.rest.pulls.get({
20+
owner: context.repo.owner,
21+
repo: context.repo.repo,
22+
pull_number: context.issue.number
23+
});
24+
25+
const body = pr.data.body || '';
26+
const issueRegex = new RegExp(`(${process.env.VALID_ISSUE_PREFIXES})-\\d+`, 'i');
27+
28+
if (!issueRegex.test(body)) {
29+
core.setFailed(
30+
`No valid issue reference found. PR body must contain an issue ID with one of these prefixes: ${process.env.VALID_ISSUE_PREFIXES}`
31+
);
32+
return;
33+
}
34+
35+
const matches = body.match(issueRegex);
36+
console.log(`Found issue reference: ${matches[0]}`);

.github/workflows/linear.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)