Files
cozystack/hack/build-talos-needed.sh
Myasnikov Daniil 975ea6acb7 ci(workflows): gate Talos builds on their inputs
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>
2026-09-10 17:48:22 +05:00

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