diff --git a/README.md b/README.md index d47f142..a4a9ddd 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,12 @@ action "Assignee to reviewer" { secrets = [ "GITHUB_TOKEN" ] + + # add this line if you want to continue running parrallel github actions even if this action is skipped/not needed + env = { + REVIEWERS_UNMODIFIED_EXIT_CODE = "0" + } +} } ``` diff --git a/entrypoint.sh b/entrypoint.sh index b5f8df2..f2e8fe1 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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 \ No newline at end of file + exit "$REVIEWERS_UNMODIFIED_EXIT_CODE" +fi