2 Commits

Author SHA1 Message Date
peptiderepo
c680906112 ci(audit): retry PR-association check to stop false positives on squash-merges
listPullRequestsAssociatedWithCommit is eventually-consistent after a squash
merge; the single immediate call intermittently flagged legit merges as
'direct push to main'. Now polls up to 5x/10s before opening an issue.

Agent-Session: cto audit-race-fix
2026-06-09 13:38:33 +07:00
peptiderepo
3b65c2c102 ci: restore deploy pipeline (#29)
Same 0-job-failure fix as prautoblogger #147 / prcore #14.

Agent-Session: cto restore-deploy-org-sweep
2026-06-09 13:27:02 +07:00
2 changed files with 16 additions and 7 deletions

View File

@@ -80,7 +80,6 @@ jobs:
smoke: smoke:
name: Smoke tests (staging) name: Smoke tests (staging)
needs: deploy-staging needs: deploy-staging
continue-on-error: true
uses: peptiderepo/peptide-e2e/.github/workflows/smoke.yml@main uses: peptiderepo/peptide-e2e/.github/workflows/smoke.yml@main
secrets: secrets:
STAGING_WP_ADMIN_USER: ${{ secrets.STAGING_WP_ADMIN_USER }} STAGING_WP_ADMIN_USER: ${{ secrets.STAGING_WP_ADMIN_USER }}

View File

@@ -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;