Repository navigation
fix(guardrail): detect direct pushes using merged PR records - #55
greenc-FNAL wants to merge 2 commits into
Conversation
Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the updated direct-push alert workflow.
No open issues 🎉
What changed in this PR
Updates the direct-push alert workflow to recognize merges into main through GitHub’s merged-PR records, including rebase merges, rather than committer names.
Changes:
- Matches pushed commits against merged PRs while always alerting on forced updates.
- Removes the Dependabot exemption and grants only pull-request read permission.
- Preserves safe Slack JSON construction and makes API, missing-webhook, and HTTP delivery errors fail the workflow.
| File | Description |
|---|---|
.github/workflows/guardrail-audit-alert.yaml |
Replaces committer-based detection with PR-record checks and strengthens Slack delivery error handling. |
Review effort: Balanced
|
The guardrail update is published and its actionlint, YAML, and dedicated guardrail-test jobs pass. The remaining CodeQL failure predates this update: init is pinned to 4.39.1 while analyze remains at 4.38.2, producing "Loaded a configuration file for version 4.39.1, but running version 4.38.2". The original PR-head CI already failed (https://github.com/Framework-R-D/action-detect-relevant-changes/actions/runs/40935298766). The matching analyze dependency update is already open as #51. Those existing pins were intentionally left unchanged in this guardrail-only correction. |
Summary
mainusing GitHub's merged-PR records, including rebase merges, rather than trusting committer names or exempting bot pushes.repository.pushed_at, accepting epoch or UTC ISO timestamps within a documented 60-second tolerance. This avoids runner-queue and rerun timing errors and alerts on stale merge restorations.Scope and relationships
Changes are limited to
.github/workflows/guardrail-audit-alert.yaml,.github/workflows/ci.yaml, andtests/test_guardrail_audit_alert.py. Action interfaces, releases, dependencies, and existing Python tooling are unchanged. The guardrail workflow and test file are identical across all fifteen action repositories; other CI content and pins are preserved.This addresses the concern reviewed in action-detect-act-env#53, without using the unsupported
github.run_started_atcontext from Copilot's corrective commit. The guardrail correction can merge independently of the actionlint-pinning PR.Validation
Known limitation
This is best-effort temporal correlation, not complete event-provenance tracking. A rewind and restoration within 60 seconds of the original PR merge may still suppress the restoration alert. That bounded limitation is intentional; exact detection of every replay is outside this change's scope.
mainbase branch, and push event timestamp. Accepts epoch or UTC ISO timestamps within a 60-second window.