Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/governed-pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,35 @@ jobs:
run: |
gh api "repos/${REPOSITORY}/pulls/${PR_NUMBER}/files?per_page=100" > pr-files.json

- name: Validate governed PR check tooling source
run: |
set -euo pipefail
PRIMARY_TOOL_PATH="governed-pr-check-tools/.github/scripts/governed_pr_check.py"
LEGACY_TOOL_PATH=".github/scripts/governed_pr_check.py"

if [ -f "$PRIMARY_TOOL_PATH" ]; then
echo "[governed-pr-check] tooling path found: $PRIMARY_TOOL_PATH"
exit 0
fi

{
echo "## Governed PR Check hard-fail"
echo "Detected missing required tooling path: $PRIMARY_TOOL_PATH"
echo "Reason: wrong workflow revision/tooling source"
} >> "$GITHUB_STEP_SUMMARY"

if [ -f "$LEGACY_TOOL_PATH" ]; then
echo "::error::workflow hard-fail: wrong workflow revision/tooling source. Expected $PRIMARY_TOOL_PATH but found $LEGACY_TOOL_PATH."
echo "::error::This reusable workflow is pinned to a legacy tooling revision that does not include the tool checkout directory."
echo "::error::Pin the caller to a fixed SHA that includes the governed-pr-check-tools checkout path (example: b250900...)."
else
echo "::error::workflow hard-fail: wrong workflow revision/tooling source. Expected $PRIMARY_TOOL_PATH."
echo "::error::No legacy path found at $LEGACY_TOOL_PATH either."
echo "::error::The governed PR check script is unavailable in this workflow source. Update reusable workflow source before rerunning."
fi

exit 1

- name: Run governed PR check
run: |
python3 governed-pr-check-tools/.github/scripts/governed_pr_check.py \
Expand Down
Loading