From 1ed259c59ee9e53619a1ef50504a5a4d7c207829 Mon Sep 17 00:00:00 2001 From: neel-astro Date: Wed, 5 Feb 2025 14:28:10 +0530 Subject: [PATCH] fix PR cases --- action.yaml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/action.yaml b/action.yaml index bd7ff5a..f739af6 100644 --- a/action.yaml +++ b/action.yaml @@ -371,14 +371,7 @@ runs: # case when the triggered event is a manual workflow dispatch or a new branch or tag creation, we would need to deploy the image because we cannot determine that it does not need to be deployed if [[ "$GITHUB_EVENT_BEFORE" == "0000000000000000000000000000000000000000" || -z $GITHUB_EVENT_BEFORE && -z $GITHUB_EVENT_AFTER ]]; then echo "Manual workflow dispatch or a new branch or tag creation, hence missing github event before and/or after commit hash" - elif [[ "$GITHUB_REF" == refs/pull/*/merge ]]; then - pr_number="${GITHUB_REF#refs/pull/}" - pr_number="${pr_number%%/*}" - echo "Pull request triggered the workflow: $pr_number" - DAGS_ONLY_DEPLOY=false - SKIP_IMAGE_OR_DAGS_DEPLOY=false - files=() - elif [[ "$GITHUB_REF" == refs/heads/* ]]; then + else branch=$(echo "${GITHUB_REF#refs/heads/}") echo "Branch push triggered the workflow: $branch" git fetch origin $branch @@ -387,11 +380,8 @@ runs: else SKIP_IMAGE_OR_DAGS_DEPLOY=true files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }}) + echo "files changed: $files" fi - echo "files changed: $files" - else - echo "Unknown event type: $GITHUB_REF, using image deploy" - fi for file in $files; do if [[ $file =~ ^"${{ inputs.root-folder }}".* ]]; then