headroom/scripts/validate-workflows.sh
Copilot 96a7d7cbbe
Fix CI lint failure by formatting PR governance scripts (#933)
`CI / lint (pull_request)` failed because `ruff format --check` detected
formatting drift in the new PR governance script and its tests. This PR
aligns those files with repository formatting rules so the lint job can
pass.

- **Root cause**
  - `ruff format --check .` reported two files as non-canonical:
    - `scripts/pr-governance.py`
    - `scripts/tests/test_pr_governance.py`

- **Change set**
  - Applied `ruff` formatting to only the two flagged files.
- No behavioral or logic changes; edits are line-wrap/format
normalization only.

- **Representative update**
  ```python
  parser.add_argument(
"--event", type=Path, required=True, help="Path to the GitHub event
payload JSON."
  )
  ```

---------

Co-authored-by: JerrettDavis <mxjerrett@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-06-12 17:11:39 -05:00

37 lines
1.4 KiB
Bash

#!/usr/bin/env bash
set -euo pipefail
actionlint .github/workflows/*.yml
run_act() {
local attempt=1
local max_attempts=3
local delay_seconds=5
while true; do
if "$@"; then
return 0
fi
if (( attempt >= max_attempts )); then
return 1
fi
echo "act dry-run failed on attempt ${attempt}/${max_attempts}; retrying in ${delay_seconds}s..." >&2
sleep "${delay_seconds}"
attempt=$((attempt + 1))
delay_seconds=$((delay_seconds * 2))
done
}
run_act act workflow_dispatch -W .github/workflows/release.yml -e .github/act/dry-run.json -n
# release.yml's main trigger is now `release: published` (release-please
# emits this event when its release PR is merged). The earlier `push`
# trigger on main was removed in PR #495 to gate PyPI uploads behind
# the bot's release-PR pattern. Simulate the new trigger here so the
# validation step exercises the same code path CI actually fires on.
run_act act release -W .github/workflows/release.yml -e .github/act/release-published.json -n
run_act act push -W .github/workflows/release-please.yml -e .github/act/push-feat.json -n
run_act act pull_request_target -W .github/workflows/pr-health.yml -e .github/act/pr-governance-invalid.json -n
run_act act pull_request_target -W .github/workflows/pr-health.yml -e .github/act/pr-governance-valid.json -n
run_act act workflow_dispatch -W .github/workflows/docker.yml -e .github/act/docker-version.json -n