ci: derive changed files from commit
All checks were successful
ci / changes (push) Successful in 2s
ci / backend (push) Successful in 1m47s
ci / flutter (push) Successful in 1m7s

This commit is contained in:
Oskar Kapala 2026-01-16 15:56:03 +01:00
parent 081d885242
commit 88ffab434c

View file

@ -27,20 +27,18 @@ jobs:
if [ "${GITHUB_EVENT_NAME:-}" = "pull_request" ] && [ -n "${GITHUB_BASE_REF:-}" ]; then if [ "${GITHUB_EVENT_NAME:-}" = "pull_request" ] && [ -n "${GITHUB_BASE_REF:-}" ]; then
base_ref="origin/${GITHUB_BASE_REF}" base_ref="origin/${GITHUB_BASE_REF}"
if git rev-parse --verify "$base_ref" >/dev/null 2>&1; then if git rev-parse --verify "$base_ref" >/dev/null 2>&1; then
files="$(git diff --name-only "$base_ref"...HEAD)" files="$(git diff --name-only "$base_ref"...HEAD)" || true
else else
files="$(git diff --name-only HEAD^..HEAD || true)" files=""
fi
else
if git rev-parse --verify "${GITHUB_SHA}^" >/dev/null 2>&1; then
files="$(git diff --name-only "${GITHUB_SHA}^" "${GITHUB_SHA}")"
else
files="$(git diff --name-only HEAD^..HEAD || true)"
fi fi
fi fi
if [ -z "$files" ]; then if [ -z "$files" ]; then
files="$(git ls-files)" if [ -n "${GITHUB_SHA:-}" ]; then
files="$(git show --name-only --pretty= "${GITHUB_SHA}")"
else
files="$(git show --name-only --pretty= HEAD)"
fi
fi fi
backend=false backend=false