mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
Run typecheck on CI (#478)
This commit is contained in:
+5
-5
@@ -81,7 +81,7 @@ describe("version", () => {
|
||||
|
||||
await runVersion({
|
||||
octokit: setupOctokit("@@GITHUB_TOKEN"),
|
||||
git: new Git(),
|
||||
git: new Git({ cwd }),
|
||||
cwd,
|
||||
});
|
||||
|
||||
@@ -115,7 +115,7 @@ describe("version", () => {
|
||||
|
||||
await runVersion({
|
||||
octokit: setupOctokit("@@GITHUB_TOKEN"),
|
||||
git: new Git(),
|
||||
git: new Git({ cwd }),
|
||||
cwd,
|
||||
});
|
||||
|
||||
@@ -149,7 +149,7 @@ describe("version", () => {
|
||||
|
||||
await runVersion({
|
||||
octokit: setupOctokit("@@GITHUB_TOKEN"),
|
||||
git: new Git(),
|
||||
git: new Git({ cwd }),
|
||||
cwd,
|
||||
});
|
||||
|
||||
@@ -203,7 +203,7 @@ fluminis divesque vulnere aquis parce lapsis rabie si visa fulmineis.
|
||||
|
||||
await runVersion({
|
||||
octokit: setupOctokit("@@GITHUB_TOKEN"),
|
||||
git: new Git(),
|
||||
git: new Git({ cwd }),
|
||||
cwd,
|
||||
prBodyMaxCharacters: 1000,
|
||||
});
|
||||
@@ -261,7 +261,7 @@ fluminis divesque vulnere aquis parce lapsis rabie si visa fulmineis.
|
||||
|
||||
await runVersion({
|
||||
octokit: setupOctokit("@@GITHUB_TOKEN"),
|
||||
git: new Git(),
|
||||
git: new Git({ cwd }),
|
||||
cwd,
|
||||
prBodyMaxCharacters: 500,
|
||||
});
|
||||
|
||||
+4
-6
@@ -1,6 +1,7 @@
|
||||
import unified from "unified";
|
||||
import remarkParse from "remark-parse";
|
||||
import remarkStringify from "remark-stringify";
|
||||
import type { Root } from "mdast";
|
||||
// @ts-ignore
|
||||
import mdastToString from "mdast-util-to-string";
|
||||
import { getPackages, Package } from "@manypkg/get-packages";
|
||||
@@ -35,11 +36,11 @@ export async function getChangedPackages(
|
||||
}
|
||||
|
||||
export function getChangelogEntry(changelog: string, version: string) {
|
||||
let ast = unified().use(remarkParse).parse(changelog);
|
||||
let ast = unified().use(remarkParse).parse(changelog) as Root;
|
||||
|
||||
let highestLevel: number = BumpLevels.dep;
|
||||
|
||||
let nodes = ast.children as Array<any>;
|
||||
let nodes = ast.children;
|
||||
let headingStartInfo:
|
||||
| {
|
||||
index: number;
|
||||
@@ -75,10 +76,7 @@ export function getChangelogEntry(changelog: string, version: string) {
|
||||
}
|
||||
}
|
||||
if (headingStartInfo) {
|
||||
ast.children = (ast.children as any).slice(
|
||||
headingStartInfo.index + 1,
|
||||
endIndex
|
||||
);
|
||||
ast.children = ast.children.slice(headingStartInfo.index + 1, endIndex);
|
||||
}
|
||||
return {
|
||||
content: unified().use(remarkStringify).stringify(ast),
|
||||
|
||||
Reference in New Issue
Block a user