diff --git a/.github/workflows/build-and-remove-template.yml b/.github/workflows/build-and-remove-template.yml index a0667482..64fa7ea2 100644 --- a/.github/workflows/build-and-remove-template.yml +++ b/.github/workflows/build-and-remove-template.yml @@ -38,18 +38,22 @@ jobs: # check whether anything at that path has been modified relative to master's head. # If so, we'll set `env.changed=true` to trigger the build in a later step - name: Check for changes - if: inputs.always-build == 'false' + if: ${{ inputs.always-build }} == 'false' id: check_changes run: | - if git fetch origin master && git diff --name-only origin/master | grep -q "${{ inputs.path }}"; then + if git fetch origin master && git diff --name-only origin/master | grep -q "$(basename ${{ inputs.path }})"; then + echo "Changes detected to ${{inputs.path}}." echo "changed=true" >> $GITHUB_ENV else + echo "No changes detected to ${{ inputs.path}}" echo "changed=false" >> $GITHUB_ENV fi - name: Set changed to true for always-build - if: inputs.always-build == 'true' - run: echo "changed=true" >> $GITHUB_ENV + if: ${{ inputs.always-build }} == 'true' + run: | + echo "Input for job 'always-build' is true -- building regardless of detected changes." + echo "changed=true" >> $GITHUB_ENV - name: Build Docker image if: env.changed == 'true'