ci: Detect new unpublished packages after merge and add manual publish workflow (#27611)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Matsu
2026-03-26 12:06:10 +00:00
committed by GitHub
co-authored by Claude Sonnet 4.6
parent 44af2a1bbd
commit d1fd399ca2
3 changed files with 95 additions and 1 deletions
+8 -1
View File
@@ -16,6 +16,7 @@
import child_process from 'child_process';
import { promisify } from 'util';
import { writeGithubOutput } from './github-helpers.mjs';
const exec = promisify(child_process.exec);
@@ -31,6 +32,7 @@ for (const { name, private: isPrivate } of packages) {
const url = `https://registry.npmjs.org/${encodedName}`;
try {
console.log(`Checking if ${name} exists...`);
const response = await fetch(url, { method: 'HEAD' });
if (response.status === 404) {
newPackages.push(name);
@@ -63,7 +65,6 @@ OIDC Trusted Publishing until they have been published at least once manually:
`);
for (const pkg of newPackages) {
console.log(` - ${pkg}`);
console.log(
`::error::Package "${pkg}" has never been published to npm. A manual first-publish with an NPM token is required before it can use OIDC Trusted Publishing.`,
);
@@ -88,4 +89,10 @@ Steps to unblock the release, for each new package listed above:
3. Re-run the Release: Publish workflow.
`);
const output = {
packages: newPackages.join(','),
};
console.log(` -- Writing to github output: ${JSON.stringify(output)}`);
writeGithubOutput(output);
process.exit(1);