You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# First push to branch (no "before" commit)? Force rebuild.
37
-
if [ "$BEFORE" = "0000000000000000000000000000000000000000" ]; then
38
-
echo "First push on this branch -> rebuild image"
39
-
echo "docker_changed=true" >> "$GITHUB_OUTPUT"
40
-
exit 0
41
-
fi
42
-
43
-
echo "Diffing $BEFORE..$SHA"
44
-
45
-
# If BEFORE commit is not in this clone (rebased branch / force push / shallow mismatch),
46
-
# just force a rebuild instead of trying to diff.
47
-
if ! git cat-file -e "$BEFORE^{commit}" 2>/dev/null; then
48
-
echo "Base commit $BEFORE not found in local history -> rebuild image"
49
-
echo "docker_changed=true" >> "$GITHUB_OUTPUT"
50
-
exit 0
51
-
fi
52
-
53
-
files="$(git diff --name-only "$BEFORE" "$SHA")"
54
-
echo "Changed files:"
55
-
echo "$files"
56
-
57
-
if echo "$files" | grep -E '^(Dockerfile|Makefile|pyproject.toml|ibex-soc/python-requirements.txt|ibex-soc/vendor/google_riscv-dv/requirements.txt)$' >/dev/null; then
58
-
echo "Docker / env inputs changed -> rebuild"
59
-
echo "docker_changed=true" >> "$GITHUB_OUTPUT"
60
-
else
61
-
echo "No Dockerfile/Makefile/pyproject/req changes -> reuse existing image"
62
-
echo "docker_changed=false" >> "$GITHUB_OUTPUT"
63
-
fi
31
+
set -euo pipefail
32
+
33
+
# Only these files affect the image tag. Add/remove paths as desired.
0 commit comments