Skip to content

Commit

Permalink
Handle case when triggered event is a manual workflow_dispatch (#97)
Browse files Browse the repository at this point in the history
Co-authored-by: Saketh Somaraju <[email protected]>
  • Loading branch information
sakethsomaraju and Saketh Somaraju authored Dec 10, 2024
1 parent e6e4fdf commit 2d5726c
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,14 @@ runs:
DBT_DEPLOY=false
# case when the triggered event is a new branch or tag creation, we would need to deploy the dbt project because we cannot determine that it does not need to be deployed
if [[ "${{ github.event.before }}" == "0000000000000000000000000000000000000000" ]]
then
DBT_DEPLOY=true
files=()
# case when the triggered event is a manual workflow dispatch or a new branch or tag creation, we would need to deploy the dbt project because we cannot determine that it does not need to be deployed
GITHUB_EVENT_BEFORE=${{ github.event.before }}
GITHUB_EVENT_AFTER=${{ github.event.after }}
if [[ "$GITHUB_EVENT_BEFORE" == "0000000000000000000000000000000000000000" || -z $GITHUB_EVENT_BEFORE && -z $GITHUB_EVENT_AFTER ]]; then
DBT_DEPLOY=true
files=()
else
files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }})
files=$(git diff --name-only $GITHUB_EVENT_BEFORE $GITHUB_EVENT_AFTER)
echo "files changed: $files"
fi
Expand Down Expand Up @@ -368,14 +369,15 @@ runs:
DAGS_ONLY_DEPLOY=false
SKIP_IMAGE_OR_DAGS_DEPLOY=true
# case when the triggered event is 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" ]]
then
DAGS_ONLY_DEPLOY=false
SKIP_IMAGE_OR_DAGS_DEPLOY=false
files=()
# 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
GITHUB_EVENT_BEFORE=${{ github.event.before }}
GITHUB_EVENT_AFTER=${{ github.event.after }}
if [[ "$GITHUB_EVENT_BEFORE" == "0000000000000000000000000000000000000000" || -z $GITHUB_EVENT_BEFORE && -z $GITHUB_EVENT_AFTER ]]; then
DAGS_ONLY_DEPLOY=false
SKIP_IMAGE_OR_DAGS_DEPLOY=false
files=()
else
files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }})
files=$(git diff --name-only $GITHUB_EVENT_BEFORE $GITHUB_EVENT_AFTER)
echo "files changed: $files"
fi
Expand Down

0 comments on commit 2d5726c

Please sign in to comment.