You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(ci): skip the diff-based audits when there is no base, instead of guessing one
Follow-up to #7033, which merged with this thread open.
A push that creates a branch reports an all-zero `github.event.before`, and the
fallback answered that with `HEAD~1` — auditing the single tip commit while
reporting on the whole push. That is the same partial-audit-reported-as-complete
failure #7033 set out to remove, one case further along.
There is no correct base to substitute. Nothing precedes the push, and diffing
the whole history would lint every migration ever written. So the audits skip
with a `::notice::` naming the reason. A stated skip is honest; a partial audit
wearing a green check is not.
The same branch also covers `workflow_dispatch`, where `before` is empty rather
than all-zero because there is no push payload at all. The guard has to test both
— an empty `before` reaching the fetch would run `git fetch origin ""` and fail
the job outright, which this workflow allows since it declares `workflow_dispatch`.
Dropping the fallback drops its only consumer: `fetch-depth: 2` existed to give
`HEAD~1` something to resolve to, and `before` is fetched by SHA, so the checkout
returns to the default depth.
Traced all four event shapes through the branch — PR, ordinary push, branch
creation, manual dispatch — and verified both audits still pass against a raw SHA
base.
0 commit comments