mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-03 02:27:01 +09:00
Classify the rename-blind changed-path list against direct Talos sources and shared build inputs. This lets same-repository pull requests skip the heavy build while removals, renames, and build configuration changes still select it. Fork builds remain unconditional. Preserve the matchbox digest produced by a successful Talos build when finalize overlays base-branch image references. When the job is skipped, bootbox continues to receive the current base reference. Assisted-By: LLM Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
23 lines
636 B
Bash
Executable File
23 lines
636 B
Bash
Executable File
#!/bin/sh
|
|
# Print whether a changed-path list contains an input to the pull-request Talos
|
|
# build. The caller supplies the rename-blind list so removals and both sides of
|
|
# a rename are classified.
|
|
set -eu
|
|
|
|
if [ "$#" -ne 1 ] || [ ! -f "$1" ] || [ ! -r "$1" ]; then
|
|
echo "usage: build-talos-needed.sh <readable-changed-files>" >&2
|
|
exit 2
|
|
fi
|
|
|
|
pattern='^(packages/core/talos/[^[:space:]]+|hack/common-envs\.mk|hack/buildkitd\.toml|\.github/workflows/pull-requests\.yaml|\.dockerignore)$'
|
|
|
|
if grep -qE "$pattern" "$1"; then
|
|
printf 'true\n'
|
|
else
|
|
status=$?
|
|
if [ "$status" -ne 1 ]; then
|
|
exit "$status"
|
|
fi
|
|
printf 'false\n'
|
|
fi
|