Skip to content

Commit

Permalink
fix PR cases
Browse files Browse the repository at this point in the history
  • Loading branch information
neel-astro committed Feb 5, 2025
1 parent d727b89 commit 1ed259c
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 1ed259c

Please sign in to comment.