diff --git a/entrypoint.sh b/entrypoint.sh index aeb6f45..c4cf99e 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,6 +2,14 @@ set -e +if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then + EVENT_ACTION=$(jq -r ".action" "${GITHUB_EVENT_PATH}") + if [[ "${EVENT_ACTION}" != "opened" ]]; then + echo "No need to run analysis. It is already triggered by the push event." + exit 78 + fi +fi + if [[ -z "${INPUT_PASSWORD}" ]]; then SONAR_PASSWORD="&& true" else