Sort things by public/private

This commit is contained in:
mitchellhamilton
2019-09-17 12:43:32 +10:00
parent 902339ecb3
commit 564f71feba
5 changed files with 70 additions and 5 deletions
+8 -2
View File
@@ -4,7 +4,12 @@ import * as github from "@actions/github";
import fs from "fs-extra";
import getWorkspaces, { Workspace } from "get-workspaces";
import path from "path";
import { getChangelogEntry, execWithOutput, getChangedPackages } from "./utils";
import {
getChangelogEntry,
execWithOutput,
getChangedPackages,
sortTheThings
} from "./utils";
import * as semver from "semver";
(async () => {
@@ -223,6 +228,7 @@ import * as semver from "semver";
);
return {
highestLevel: entry.highestLevel,
private: !!workspace.config.private,
content:
`## ${workspace.name}@${workspace.config.version}\n\n` +
entry.content
@@ -230,7 +236,7 @@ import * as semver from "semver";
})
))
.filter(x => x)
.sort((a, b) => b.highestLevel - a.highestLevel)
.sort(sortTheThings)
.map(x => x.content)
.join("\n ")
);