Skip to content

Commit

Permalink
[prevent-cancelling-other-workflows] allow an optional environment va…
Browse files Browse the repository at this point in the history
…riable for specifying a desired exitcode
  • Loading branch information
mcpengelly committed Jun 17, 2019
1 parent 1eac22d commit 6e109f4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -23,6 +23,12 @@ action=$(jq --raw-output .action "$GITHUB_EVENT_PATH")
number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
assignee=$(jq --raw-output .assignee.login "$GITHUB_EVENT_PATH")

# Github Actions will mark a check as "neutral" (neither failed/succeeded) when you exit with code 78
# But this will terminate any other Actions running in parallel in the same workflow.
# Configuring this Environment Variable `REVIEWERS_UNMODIFIED_EXIT_CODE=0` if no branch was deleted will let your workflow continue.
# Docs: https://developer.github.com/actions/creating-github-actions/accessing-the-runtime-environment/#exit-codes-and-statuses
REVIEWERS_UNMODIFIED_EXIT_CODE=${REVIEWERS_UNMODIFIED_EXIT_CODE:-78}

update_review_request() {
curl -sSL \
-H "Content-Type: application/json" \
@@ -39,5 +45,5 @@ elif [[ "$action" == "unassigned" ]]; then
update_review_request 'DELETE'
else
echo "Ignoring action ${action}"
exit 78
fi
exit "$REVIEWERS_UNMODIFIED_EXIT_CODE"
fi

4 comments on commit 6e109f4

@minhtriet8752
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@minhtriet8752
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

giup tôi

@minhtriet8752
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@minhtriet8752
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Please sign in to comment.