Skip to content

Commit 7599f59

Browse files
authored
Merge pull request #5287 from modelcontextprotocol/v2/chore/5261-codeql-release-scripts
chore(scripts): clear the four CodeQL alerts in the release scripts
2 parents 1bfb371 + 8465c26 commit 7599f59

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎scripts/npm-publish-guard.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const REGISTRY = "https://registry.npmjs.org";
4242
* @returns {string}
4343
*/
4444
export function packageUrl(name) {
45-
return `${REGISTRY}/${name.replace("/", "%2F")}`;
45+
return `${REGISTRY}/${name.replaceAll("/", "%2F")}`;
4646
}
4747

4848
/**

‎scripts/release-notes.mjs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ export function packagesAt(spawn, sha) {
277277
*/
278278
export function registryUrl(pkg) {
279279
return pkg.registry === "npm"
280-
? `https://registry.npmjs.org/${pkg.name.replace("/", "%2F")}/${pkg.version}`
280+
? `https://registry.npmjs.org/${pkg.name.replaceAll("/", "%2F")}/${pkg.version}`
281281
: `https://pypi.org/pypi/${pkg.name}/${pkg.version}/json`;
282282
}
283283

@@ -347,7 +347,8 @@ export function parseGenerated(body) {
347347
inContributors = line === "## New Contributors";
348348
continue;
349349
}
350-
if (line === "" || /^<!--.*-->$/.test(line)) continue;
350+
if (line === "" || (line.startsWith("<!--") && line.endsWith("-->")))
351+
continue;
351352
if (line.startsWith("**Full Changelog**")) {
352353
changelog = line;
353354
continue;

‎scripts/release-notes.test.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ function world({
687687
const fetch = async (url) => {
688688
fetched.push(url);
689689
const name = Object.values(packages).find((p) =>
690-
url.includes(p.name.replace("/", "%2F")),
690+
url.includes(p.name.replaceAll("/", "%2F")),
691691
)?.name;
692692
return { status: name && onRegistry.includes(name) ? 200 : 404 };
693693
};

0 commit comments

Comments
 (0)