From 725eed3741202b258edd6b061c034cd2b41c8938 Mon Sep 17 00:00:00 2001 From: Kevin Minehart <5140827+kminehart@users.noreply.github.com> Date: Tue, 23 Sep 2025 09:50:24 -0500 Subject: [PATCH] Add missing script --- .../workflows/scripts/validate-commit-in-head.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 .github/workflows/scripts/validate-commit-in-head.sh diff --git a/.github/workflows/scripts/validate-commit-in-head.sh b/.github/workflows/scripts/validate-commit-in-head.sh new file mode 100755 index 00000000000..370b2fbd4af --- /dev/null +++ b/.github/workflows/scripts/validate-commit-in-head.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [[ -z "${GIT_COMMIT:-}" ]]; then + echo "Error: Environment variable GIT_COMMIT is required" + exit 1 +fi + +if git merge-base --is-ancestor "$GIT_COMMIT" HEAD; then + echo "Commit $GIT_COMMIT is contained in HEAD" +else + echo "Error: Commit $GIT_COMMIT is not contained in HEAD" + exit 1 +fi