fix: do not run on draft PRs
This commit is contained in:
parent
620cbfbc74
commit
381ef1c2d1
2 changed files with 20 additions and 10 deletions
|
|
@ -29,12 +29,17 @@ runs:
|
|||
SHOULD_RUN="false"
|
||||
|
||||
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
||||
# Check PR author association
|
||||
AUTHOR_ASSOC="${{ github.event.pull_request.author_association }}"
|
||||
if [ "$AUTHOR_ASSOC" = "OWNER" ] || [ "$AUTHOR_ASSOC" = "MEMBER" ] || [ "$AUTHOR_ASSOC" = "COLLABORATOR" ]; then
|
||||
SHOULD_RUN="true"
|
||||
# Check if PR is a draft
|
||||
if [ "${{ github.event.pull_request.draft }}" = "true" ]; then
|
||||
echo "::notice::Skipping review - PR is a draft"
|
||||
else
|
||||
echo "::notice::Skipping review - PR author is not a team member (association: $AUTHOR_ASSOC)"
|
||||
# Check PR author association
|
||||
AUTHOR_ASSOC="${{ github.event.pull_request.author_association }}"
|
||||
if [ "$AUTHOR_ASSOC" = "OWNER" ] || [ "$AUTHOR_ASSOC" = "MEMBER" ] || [ "$AUTHOR_ASSOC" = "COLLABORATOR" ]; then
|
||||
SHOULD_RUN="true"
|
||||
else
|
||||
echo "::notice::Skipping review - PR author is not a team member (association: $AUTHOR_ASSOC)"
|
||||
fi
|
||||
fi
|
||||
elif [ "${{ github.event_name }}" = "issue_comment" ]; then
|
||||
# Check if it's a PR comment with the trigger phrase
|
||||
|
|
|
|||
|
|
@ -29,12 +29,17 @@ runs:
|
|||
SHOULD_RUN="false"
|
||||
|
||||
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
||||
# Check PR author association
|
||||
AUTHOR_ASSOC="${{ github.event.pull_request.author_association }}"
|
||||
if [ "$AUTHOR_ASSOC" = "OWNER" ] || [ "$AUTHOR_ASSOC" = "MEMBER" ] || [ "$AUTHOR_ASSOC" = "COLLABORATOR" ]; then
|
||||
SHOULD_RUN="true"
|
||||
# Check if PR is a draft
|
||||
if [ "${{ github.event.pull_request.draft }}" = "true" ]; then
|
||||
echo "::notice::Skipping review - PR is a draft"
|
||||
else
|
||||
echo "::notice::Skipping review - PR author is not a team member (association: $AUTHOR_ASSOC)"
|
||||
# Check PR author association
|
||||
AUTHOR_ASSOC="${{ github.event.pull_request.author_association }}"
|
||||
if [ "$AUTHOR_ASSOC" = "OWNER" ] || [ "$AUTHOR_ASSOC" = "MEMBER" ] || [ "$AUTHOR_ASSOC" = "COLLABORATOR" ]; then
|
||||
SHOULD_RUN="true"
|
||||
else
|
||||
echo "::notice::Skipping review - PR author is not a team member (association: $AUTHOR_ASSOC)"
|
||||
fi
|
||||
fi
|
||||
elif [ "${{ github.event_name }}" = "issue_comment" ]; then
|
||||
# Check if it's a PR comment with the trigger phrase
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue