Skip to content

Commit d4563b8

Browse files
authored
Add linear check to PRs (onyx-dot-app#3708)
* add linear check * Update pull_request_template.md
1 parent a54ed77 commit d4563b8

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

.github/pull_request_template.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
## Description
2-
[Provide a brief description of the changes in this PR]
32

3+
[Provide a brief description of the changes in this PR]
44

55
## How Has This Been Tested?
6-
[Describe the tests you ran to verify your changes]
76

7+
[Describe the tests you ran to verify your changes]
88

99
## Backporting (check the box to trigger backport action)
10+
1011
Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.
12+
1113
- [ ] This PR should be backported (make sure to check that the backport attempt succeeds)
14+
- [ ] [Optional] Override Linear Check

.github/workflows/pr-linear-check.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Ensure PR references Linear
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, reopened, synchronize]
6+
7+
jobs:
8+
linear-check:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check PR body for Linear link or override
12+
run: |
13+
PR_BODY="${{ github.event.pull_request.body }}"
14+
15+
# Looking for "https://linear.app" in the body
16+
if echo "$PR_BODY" | grep -qE "https://linear\.app"; then
17+
echo "Found a Linear link. Check passed."
18+
exit 0
19+
fi
20+
21+
# Looking for a checked override: "[x] Override Linear Check"
22+
if echo "$PR_BODY" | grep -q "\[x\].*Override Linear Check"; then
23+
echo "Override box is checked. Check passed."
24+
exit 0
25+
fi
26+
27+
# Otherwise, fail the run
28+
echo "No Linear link or override found in the PR description."
29+
exit 1

0 commit comments

Comments
 (0)