Skip to content

Commit b0b9b93

Browse files
proper dockerfile diff tracking in update build env
1 parent c8fda62 commit b0b9b93

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/update_build_environment.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,16 @@ jobs:
1919
run: |
2020
echo "GitHub PR action type: ${{ github.event.action }}"
2121
echo "Checking if the PR modifies the Dockerfile"
22-
if git diff --quiet ${{ github.event.before }} ${{ github.event.after }} Dockerfile; then
23-
echo "PR synchronized/opened, but Dockerfile was not edited. Not rebuilding the image."
22+
echo "GitHub event before: ${{ github.event.before }}"
23+
echo "GitHub event before: ${{ github.event.after }}"
24+
git diff --quiet ${{ github.event.before }} ${{ github.event.after }} Dockerfile
25+
DIFFSTATUS=$?
26+
echo "Diff (1 if diff, 0 if not): $DIFFSTATUS"
27+
if [ $DIFFSTATUS -eq 0 ]; then
28+
echo "PR synchronized, but Dockerfile was not edited. Not rebuilding the image."
2429
echo "stale_dockerfile=false" >> "$GITHUB_OUTPUT"
2530
else
26-
echo "PR synchronized/opened, and Dockerfile was edited, so rebuilding the image."
31+
echo "PR synchronized, and Dockerfile was edited, so rebuilding the image."
2732
echo "stale_dockerfile=true" >> "$GITHUB_OUTPUT"
2833
fi
2934
- name: Rebuild and publish image

0 commit comments

Comments
 (0)