Skip to content

Commit

Permalink
Only accept merge if PR squash
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts committed Dec 6, 2023
1 parent f662ff6 commit 9c5d68f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@ runs:
elif [ ${{ github.event_name }} == 'push' ]
then
echo "Event type: push"
echo ${{ github.event.head_commit.message }}
# pr=$(echo ${{ github.event.head_commit }} | grep -Eo "pr-[0-9]+" | cut -d '-' -f2)
pr=$(echo ${{ github.event.head_commit.message }} | grep -Eo "pr-[0-9]+" | cut -d '-' -f2)
if [ -z "${{ pr }}" ]
then
echo "No PR number found. Was this push triggered by a squashed PR merge?"
pr=""
fi
else
echo "Event type: unknown or unexpected"
fi
Expand Down

0 comments on commit 9c5d68f

Please sign in to comment.