ci: Fix urlencoding in set-latest ci script (#28965)

This commit is contained in:
Matsu 2026-04-23 14:22:08 +03:00 committed by GitHub
parent 9997203667
commit af25a0e7eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9,8 +9,8 @@ const NPM_REGISTRY = 'https://registry.npmjs.org';
* @param {string} token
*/
async function setDistTag(name, version, tag, token) {
// Scoped package names need the slash encoded (e.g. @n8n/foo → @n8n%2ffoo)
const encodedName = name.replace('/', '%2f');
// Scoped package names need both @ and / encoded (e.g. @n8n/foo → %40n8n%2ffoo)
const encodedName = encodeURIComponent(name);
const url = `${NPM_REGISTRY}/-/package/${encodedName}/dist-tags/${tag}`;
return fetch(url, {
@ -33,6 +33,7 @@ async function setLatestForMonorepoPackages() {
const publishedPackages = packages //
.filter((pkg) => !pkg.private)
.filter((pkg) => pkg.name.startsWith('@n8n/'))
.filter((pkg) => pkg.version);
const failures = [];