Compare commits
1 Commits
claude/ado
...
claude/aud
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8a3e6231c |
22
.github/workflows/main-push-audit.yml
vendored
22
.github/workflows/main-push-audit.yml
vendored
@@ -29,12 +29,22 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const sha = context.sha;
|
const sha = context.sha;
|
||||||
const { data: prs } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
|
// Squash-merge -> PR association is eventually-consistent; poll briefly
|
||||||
owner: context.repo.owner,
|
// before concluding this was a direct push (avoids false positives on merges).
|
||||||
repo: context.repo.repo,
|
async function findMergedPR() {
|
||||||
commit_sha: sha,
|
for (let attempt = 1; attempt <= 5; attempt++) {
|
||||||
});
|
const { data: prs } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
|
||||||
const merged = prs.find(p => p.merged_at);
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
commit_sha: sha,
|
||||||
|
});
|
||||||
|
const m = prs.find(p => p.merged_at);
|
||||||
|
if (m) return m;
|
||||||
|
if (attempt < 5) await new Promise(r => setTimeout(r, 10000));
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
const merged = await findMergedPR();
|
||||||
if (merged) {
|
if (merged) {
|
||||||
core.info(`OK: commit ${sha.substring(0,7)} came from PR #${merged.number}`);
|
core.info(`OK: commit ${sha.substring(0,7)} came from PR #${merged.number}`);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user