File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -64,13 +64,17 @@ jobs:
6464 ### Here we are taking only the numerical value ie. issue number
6565 ### head -n1 only prints the 1st line.
6666 ### grep -o -E "[0-9]+ basically outputs only the number between [0-9]+
67- issue_num=$(echo "$PR_BODY" | grep -iE "$pattern1" | head -n1 | grep -o -E "[0-9]+")
67+ echo "$PR_BODY" | grep -iE "$pattern1" | head -n1 | grep -o -E "[0-9]+" | tr -d '\r\n' > issue_num
68+ issue_num=$(cat issue_num)
6869 echo "issue_num is : $issue_num"
6970 elif echo "$PR_BODY" | grep -iEq "$pattern2"; then
70- issue_num=$(echo "$PR_BODY" | grep -iE "$pattern2" | head -n1 | awk -F '/' '{print $NF}')
71+ echo "$PR_BODY" | grep -iE "$pattern2" | head -n1 | awk -F '/' '{print $NF}' | tr -d '\r\n' > issue_num
72+ issue_num=$(cat issue_num)
7173 echo "issue_num is : $issue_num"
7274 elif echo "$PR_BODY" | grep -iEq "$pattern3"; then
73- issue_num=$(echo "$PR_BODY" | grep -iE "$pattern3" | head -n1 | awk -F '#' '{print $NF}')
75+ echo "$PR_BODY" | grep -iE "$pattern3" | head -n1 | awk -F '#' '{print $NF}' | tr -d '\r\n' > issue_num
76+ issue_num=$(cat issue_num)
77+ echo "issue_num is : $issue_num"
7478 else
7579 echo "No Issue number detected hence failing the PR Validation check."
7680 gh pr edit $PRNUM --add-label "PR:Issue-verification-failed"
You can’t perform that action at this time.
0 commit comments