Skip to content

Commit 0a7d3e1

Browse files
committed
Check for linear in PR description
1 parent a365dd8 commit 0a7d3e1

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/linear.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Linear in description
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- edited
8+
9+
jobs:
10+
check_linear_in_pr_description:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Get pull request info
14+
id: pr-info
15+
run: |
16+
# Fetch the pull request description using GitHub's API
17+
pr_description=$(curl -s \
18+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
19+
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }} | jq -r .body)
20+
21+
echo "Pull Request Description: $pr_description"
22+
echo "::set-output name=description::$pr_description"
23+
24+
- name: Check for linear in PR description
25+
run: |
26+
if echo "${{ steps.pr-info.outputs.description }}" | grep -qi "linear"; then
27+
echo "'linear' found in the pull request description."
28+
else
29+
echo "'linear' not found in the pull request description."
30+
exit 1
31+
fi

0 commit comments

Comments
 (0)