Skip to content

Commit f81ffa9

Browse files
committed
Check for linear in PR description (#5216)
## Problem solved Fixes https://linear.app/thirdweb/issue/ENG-2/better-enforce-linear-use <!-- start pr-codex --> --- ## PR-Codex overview This PR introduces a GitHub Actions workflow to check the pull request body for specific keywords ("CNCT" or "DASH"). If these keywords are found, it confirms a linked issue; otherwise, it fails the check. ### Detailed summary - Added a workflow named `Check for "linear" in pull request body` in `.github/workflows/linear.yml`. - Configured the workflow to trigger on `pull_request` events (opened and edited). - Implemented a job `check_linear_in_pr_body` to verify the presence of keywords in the PR body. - Utilized `curl` to fetch the PR body and `grep` to search for keywords. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 88e96de commit f81ffa9

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/linear.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Check for "linear" in pull request body
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- edited
8+
9+
jobs:
10+
check_linear_in_pr_body:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check for linked issue in pull request body
14+
run: |
15+
pr_body=$(curl -s \
16+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
17+
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }} | jq -r .body)
18+
19+
echo "Pull Request Body: $pr_body"
20+
21+
if echo "$pr_body" | grep -iE "CNCT|DASH"; then
22+
echo "Linked issue found in the pull request body."
23+
else
24+
echo "No linked issue found in the pull request body."
25+
exit 1
26+
fi

0 commit comments

Comments
 (0)