ci(audit): retry PR-association check (#16)
* 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 * chore: bump plugin header to 0.5.0 to match PR_CORE_VERSION constant
This commit is contained in:
12
.github/workflows/main-push-audit.yml
vendored
12
.github/workflows/main-push-audit.yml
vendored
@@ -29,12 +29,22 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const sha = context.sha;
|
const sha = context.sha;
|
||||||
|
// Squash-merge -> PR association is eventually-consistent; poll briefly
|
||||||
|
// before concluding this was a direct push (avoids false positives on merges).
|
||||||
|
async function findMergedPR() {
|
||||||
|
for (let attempt = 1; attempt <= 5; attempt++) {
|
||||||
const { data: prs } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
|
const { data: prs } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
commit_sha: sha,
|
commit_sha: sha,
|
||||||
});
|
});
|
||||||
const merged = prs.find(p => p.merged_at);
|
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;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* Plugin Name: Peptide Repo Core
|
* Plugin Name: Peptide Repo Core
|
||||||
* Plugin URI: https://peptiderepo.com
|
* Plugin URI: https://peptiderepo.com
|
||||||
* Description: Canonical peptide schema — shared data layer for the peptiderepo.com ecosystem. Provides the peptide CPT, dosing rows, legal status cells, AI candidate queue, disclaimer component, and JSON-LD output.
|
* Description: Canonical peptide schema — shared data layer for the peptiderepo.com ecosystem. Provides the peptide CPT, dosing rows, legal status cells, AI candidate queue, disclaimer component, and JSON-LD output.
|
||||||
* Version: 0.4.0
|
* Version: 0.5.0
|
||||||
* Author: peptiderepo
|
* Author: peptiderepo
|
||||||
* Author URI: https://peptiderepo.com
|
* Author URI: https://peptiderepo.com
|
||||||
* License: GPL-2.0-or-later
|
* License: GPL-2.0-or-later
|
||||||
|
|||||||
Reference in New Issue
Block a user