Skip to content

Commit 9c88a76

Browse files
committed
Safely handle special characters
Signed-off-by: Fanit Kolchina <[email protected]>
1 parent 30aeef0 commit 9c88a76

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

.github/workflows/check-for-issue.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Check for issue for blogs
1+
name: Check for blog issue
22

33
on:
44
pull_request:
@@ -27,23 +27,17 @@ jobs:
2727
echo "is_new_blog=false" >> $GITHUB_OUTPUT
2828
fi
2929
30-
- name: Get PR body
31-
if: steps.check-new-blog.outputs.is_new_blog == 'true'
32-
id: pr-body
33-
run: |
34-
body="${{ github.event.pull_request.body }}"
35-
echo "body=${body}" >> $GITHUB_OUTPUT
36-
3730
- name: Check for linked issues
3831
if: steps.check-new-blog.outputs.is_new_blog == 'true'
3932
id: check-issues
4033
run: |
41-
body="${{ github.event.pull_request.body }}"
42-
if echo "$body" | grep -iE "(closes|fixes|resolves|references|ref|close|fix|resolve) #[0-9]+"; then
34+
echo "${{ github.event.pull_request.body }}" > pr_body.txt
35+
if grep -iE "(closes|fixes|resolves|references|ref|close|fix|resolve) #[0-9]+" pr_body.txt > /dev/null; then
4336
echo "has_issue=true" >> $GITHUB_OUTPUT
4437
else
4538
echo "has_issue=false" >> $GITHUB_OUTPUT
4639
fi
40+
rm pr_body.txt
4741
4842
- name: Comment if no linked issue
4943
if: steps.check-new-blog.outputs.is_new_blog == 'true' && steps.check-issues.outputs.has_issue == 'false'

0 commit comments

Comments
 (0)