Skip to content

Commit

Permalink
Fix logic and variable expansions. Add more debugging help
Browse files Browse the repository at this point in the history
  • Loading branch information
jhiemstrawisc committed Dec 9, 2024
1 parent 5a59561 commit 2c5045b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/build-and-remove-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 2c5045b

Please sign in to comment.