Skip to content

Commit

Permalink
Update pr-issue-validator.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabhtayal72 authored Aug 31, 2023
1 parent 570fd68 commit 8c9d19a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/pr-issue-validator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ jobs:
PR_BODY=$(jq -r '.pull_request.body' $GITHUB_EVENT_PATH)
echo "PR_BODY = $PR_BODY"
issue_num=$(echo "$PR_BODY" | grep -iE "$pattern" | head -n1 | grep -o -E "[0-9]+")
if [[ -z "$issue_num" ]]; then
issue_num="No issue number"
shopt -s nocasematch
if [[ "$PR_BODY" =~ "$pattern" ]]; then
issue_num=$(echo "$PR_BODY" | grep -iE "$pattern" | head -n1 | grep -o -E "[0-9]+")
echo "issue_num is : $issue_num"
else
echo "No Issue number detected hence failing the PR Validation check."
gh pr edit $PRNUM --add-label "PR:Issue-verification-failed"
gh pr edit $PRNUM --remove-label "PR:Ready-to-Review"
exit 1
fi
echo "issue_num = $issue_num"
IFS="/" read -r -a url_parts <<< "$url"
Expand Down

0 comments on commit 8c9d19a

Please sign in to comment.