Skip to content

Commit

Permalink
Suppress fail on empty grep
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts committed Dec 6, 2023
1 parent bdfb4ed commit 10e1e17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ runs:
elif [ ${{ github.event_name }} == 'push' ]
then
echo "Event type: push"
pr=$(echo ${{ github.event.head_commit.message }} | grep -Eo "pr-[0-9]+" | cut -d '-' -f2)
pr=$(echo ${{ github.event.head_commit.message }} | {grep -Eo "pr-[0-9]+" || true;} | cut -d '-' -f2)
if [ -z "${pr}" ]
then
echo "No PR number found. Was this push triggered by a squashed PR merge?"
Expand Down

0 comments on commit 10e1e17

Please sign in to comment.