File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 4848 - name : Check if build is needed
4949 id : set-output
5050 run : |
51- echo "build-needed=true " >> $GITHUB_OUTPUT
51+ echo "build-needed=false " >> $GITHUB_OUTPUT
5252
5353 if [[ "${{ github.event_name }}" == "pull_request_target" ]]; then
5454 CHANGED_FILES=$(git diff --name-only origin/main...HEAD)
6060 echo "Build is NOT needed as docker/ folder did not change."
6161 echo "build-needed=false" >> $GITHUB_OUTPUT
6262 fi
63+
64+ elif [[ "${{ github.event_name }}" == "push" ]]; then
65+ CHANGED_FILES=$(git diff --name-only ${{ github.event.before }}..${{ github.event.after }})
66+ echo "Changed files: $CHANGED_FILES"
67+ if [[ $CHANGED_FILES == *".github/docker/"* ]]; then
68+ echo "Build IS needed as .github/docker/ folder changed."
69+ echo "build-needed=true" >> $GITHUB_OUTPUT
70+ else
71+ echo "Build is NOT needed as .github/docker/ folder did not change."
72+ echo "build-needed=false" >> $GITHUB_OUTPUT
73+ fi
74+ elif [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
75+ echo "Build is needed for schedule or workflow_dispatch or schedule."
76+ echo "build-needed=true" >> $GITHUB_OUTPUT
77+ else
78+ echo "Unrecognized event: ${{ github.event_name }}. Failing the build."
79+ exit 1
6380 fi
6481
6582 # Build the amd64 natively on ubuntu-latest which is an x86_64 host
You can’t perform that action at this time.
0 commit comments