Files
ERP-core/deploy/scripts/ci-detect.sh
T
ImanThiyanga 8e472ac996
CI/CD - ERP Core / scripts (pull_request) Failing after 12m21s
CI/CD - ERP Core / e2e-typecheck (pull_request) Failing after 13m13s
CI/CD - ERP Core / frontend (pull_request) Failing after 14m5s
CI/CD - ERP Core / backend (pull_request) Failing after 14m57s
CI/CD - ERP Core / detect (pull_request) Failing after 13m42s
CI/CD - ERP Core / Build & Deploy (pull_request) Failing after 12m47s
CI/CD - ERP Core / ci-ok (pull_request) Failing after 14m58s
initialising for ci-cd pipeline
2026-09-16 11:53:55 +05:30

27 lines
1.1 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# ci-cd.yml › detect — which checks does this pull request need?
# Compares the PR head's folder tree hashes with the target branch's. Tree hashes are content
# addressed, so this needs no merge-base and works on depth-1 clones.
# shellcheck source=common.sh
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
: "${BASE_REF:?BASE_REF (the PR target branch) is required}"
base="refs/remotes/origin/$BASE_REF"
git_remote fetch -q --depth 1 "$REPO_GIT_URL" "+refs/heads/$BASE_REF:$base"
# changed <path...> — succeeds if any path differs between the target branch and HEAD.
changed() {
local p
for p in "$@"; do
if [[ "$(tree_hash "$p")" != "$(tree_hash "$p" "$base")" ]]; then return 0; fi
done
return 1
}
flag() { if changed "$@"; then echo true; else echo false; fi; }
set_output backend "$(flag "$BACKEND_PATH" "$BACKEND_TESTS_PATH" Backend/ERPCore.sln)"
set_output frontend "$(flag "$FRONTEND_PATH")"
set_output e2e "$(flag "$E2E_PATH")"
set_output scripts "$(flag deploy .gitea)"
set_output frontend_hash "$(tree_hash "$FRONTEND_PATH")"