@jakobm/peacekeeper 0.25.1 → 0.25.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -675,7 +675,9 @@ It never uses an administrator bypass or pushes directly to the default branch.
|
|
|
675
675
|
After merge, the command verifies the package files at the PR's actual merge
|
|
676
676
|
commit, tags that commit with `v<version>`, and pushes the tag. The existing
|
|
677
677
|
workflow publishes through npm trusted publishing. The command then waits for
|
|
678
|
-
the publish job and for the version to appear on npm.
|
|
678
|
+
the publish job and for the version to appear on npm. Monitoring reads the run
|
|
679
|
+
status before its jobs so a job finishing between requests does not produce a
|
|
680
|
+
false publication failure. Git and an authenticated
|
|
679
681
|
GitHub CLI (`gh`) with Contents read/write, Pull requests read/write, Actions
|
|
680
682
|
read and the policy-reading access described above are required. Registry checks
|
|
681
683
|
use a temporary npm cache and request current metadata.
|
package/dist/package.json
CHANGED
|
@@ -298,6 +298,9 @@ export default ({ configuration, releaseProtection, external: { clock, fs, os, p
|
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
300
|
if (runId) {
|
|
301
|
+
// Read the run first: it can finish while we fetch jobs. A completed
|
|
302
|
+
// run must be checked against a newer job snapshot, never an older one.
|
|
303
|
+
const runStatus = github(exec, cwd, details.host, `repos/${details.slug}/actions/runs/${runId}`, {});
|
|
301
304
|
const jobs = github(exec, cwd, details.host, `repos/${details.slug}/actions/runs/${runId}/jobs`, {
|
|
302
305
|
per_page: '100',
|
|
303
306
|
}).jobs || [];
|
|
@@ -307,7 +310,6 @@ export default ({ configuration, releaseProtection, external: { clock, fs, os, p
|
|
|
307
310
|
if (matching.length === 1 && matching[0].status === 'completed' && matching[0].conclusion !== 'success') {
|
|
308
311
|
throw new ReleaseError(`Publish job in GitHub run ${runId} ended as ${matching[0].conclusion}.`);
|
|
309
312
|
}
|
|
310
|
-
const runStatus = github(exec, cwd, details.host, `repos/${details.slug}/actions/runs/${runId}`, {});
|
|
311
313
|
if (runStatus.status === 'completed') {
|
|
312
314
|
if (matching.length !== 1 || matching[0].status !== 'completed' || matching[0].conclusion !== 'success') {
|
|
313
315
|
throw new ReleaseError(`Workflow run ${runId} completed without a successful publish job.`);
|