Merge pull request #93 from mikepenz/develop

dev -> main
This commit is contained in:
Mike Penz
2020-11-11 13:45:26 +01:00
committed by GitHub
8 changed files with 85 additions and 73 deletions
Generated Vendored
+24 -18
View File
@@ -140,7 +140,7 @@ exports.DefaultConfiguration = {
labels: ['test'] labels: ['test']
} }
], ],
ignore_labels: ["ignore"], ignore_labels: ['ignore'],
transformers: [], transformers: [],
tag_resolver: { tag_resolver: {
// defines the logic on how to resolve the previous tag, only relevant if `fromTag` is not specified // defines the logic on how to resolve the previous tag, only relevant if `fromTag` is not specified
@@ -926,7 +926,10 @@ exports.sortTags = sortTags;
function semVerSorting(tags) { function semVerSorting(tags) {
// filter out tags which do not follow semver // filter out tags which do not follow semver
const validatedTags = tags.filter(tag => { const validatedTags = tags.filter(tag => {
const isValid = semver.valid(tag.name) !== null; const isValid = semver.valid(tag.name, {
includePrerelease: true,
loose: true
}) !== null;
if (!isValid) { if (!isValid) {
core.debug(`⚠️ dropped tag ${tag.name} because it is not a valid semver tag`); core.debug(`⚠️ dropped tag ${tag.name} because it is not a valid semver tag`);
} }
@@ -934,7 +937,10 @@ function semVerSorting(tags) {
}); });
// sort using semver // sort using semver
validatedTags.sort((b, a) => { validatedTags.sort((b, a) => {
return new semver_1.SemVer(a.name).compare(b.name); return new semver_1.SemVer(a.name, {
includePrerelease: true,
loose: true
}).compare(b.name);
}); });
return validatedTags; return validatedTags;
} }
@@ -1032,7 +1038,7 @@ function buildChangelog(prs, config, options) {
if (!matched) { if (!matched) {
// we allow to have pull requests included in an "uncategorized" category // we allow to have pull requests included in an "uncategorized" category
for (const [category, pullRequests] of categorized) { for (const [category, pullRequests] of categorized) {
if (category.labels.length == 0) { if (category.labels.length === 0) {
pullRequests.push(body); pullRequests.push(body);
break; break;
} }
@@ -17318,7 +17324,7 @@ module.exports = eval("require")("encoding");
/***/ ((module) => { /***/ ((module) => {
"use strict"; "use strict";
module.exports = require("assert"); module.exports = require("assert");;
/***/ }), /***/ }),
@@ -17326,7 +17332,7 @@ module.exports = require("assert");
/***/ ((module) => { /***/ ((module) => {
"use strict"; "use strict";
module.exports = require("child_process"); module.exports = require("child_process");;
/***/ }), /***/ }),
@@ -17334,7 +17340,7 @@ module.exports = require("child_process");
/***/ ((module) => { /***/ ((module) => {
"use strict"; "use strict";
module.exports = require("events"); module.exports = require("events");;
/***/ }), /***/ }),
@@ -17342,7 +17348,7 @@ module.exports = require("events");
/***/ ((module) => { /***/ ((module) => {
"use strict"; "use strict";
module.exports = require("fs"); module.exports = require("fs");;
/***/ }), /***/ }),
@@ -17350,7 +17356,7 @@ module.exports = require("fs");
/***/ ((module) => { /***/ ((module) => {
"use strict"; "use strict";
module.exports = require("http"); module.exports = require("http");;
/***/ }), /***/ }),
@@ -17358,7 +17364,7 @@ module.exports = require("http");
/***/ ((module) => { /***/ ((module) => {
"use strict"; "use strict";
module.exports = require("https"); module.exports = require("https");;
/***/ }), /***/ }),
@@ -17366,7 +17372,7 @@ module.exports = require("https");
/***/ ((module) => { /***/ ((module) => {
"use strict"; "use strict";
module.exports = require("net"); module.exports = require("net");;
/***/ }), /***/ }),
@@ -17374,7 +17380,7 @@ module.exports = require("net");
/***/ ((module) => { /***/ ((module) => {
"use strict"; "use strict";
module.exports = require("os"); module.exports = require("os");;
/***/ }), /***/ }),
@@ -17382,7 +17388,7 @@ module.exports = require("os");
/***/ ((module) => { /***/ ((module) => {
"use strict"; "use strict";
module.exports = require("path"); module.exports = require("path");;
/***/ }), /***/ }),
@@ -17390,7 +17396,7 @@ module.exports = require("path");
/***/ ((module) => { /***/ ((module) => {
"use strict"; "use strict";
module.exports = require("stream"); module.exports = require("stream");;
/***/ }), /***/ }),
@@ -17398,7 +17404,7 @@ module.exports = require("stream");
/***/ ((module) => { /***/ ((module) => {
"use strict"; "use strict";
module.exports = require("tls"); module.exports = require("tls");;
/***/ }), /***/ }),
@@ -17406,7 +17412,7 @@ module.exports = require("tls");
/***/ ((module) => { /***/ ((module) => {
"use strict"; "use strict";
module.exports = require("url"); module.exports = require("url");;
/***/ }), /***/ }),
@@ -17414,7 +17420,7 @@ module.exports = require("url");
/***/ ((module) => { /***/ ((module) => {
"use strict"; "use strict";
module.exports = require("util"); module.exports = require("util");;
/***/ }), /***/ }),
@@ -17422,7 +17428,7 @@ module.exports = require("util");
/***/ ((module) => { /***/ ((module) => {
"use strict"; "use strict";
module.exports = require("zlib"); module.exports = require("zlib");;
/***/ }) /***/ })
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long
Generated Vendored
+3 -3
View File
@@ -3847,7 +3847,7 @@ exports.SourceMapConsumer = __webpack_require__(327).SourceMapConsumer;
/***/ ((module) => { /***/ ((module) => {
"use strict"; "use strict";
module.exports = require("fs"); module.exports = require("fs");;
/***/ }), /***/ }),
@@ -3855,7 +3855,7 @@ module.exports = require("fs");
/***/ ((module) => { /***/ ((module) => {
"use strict"; "use strict";
module.exports = require("module"); module.exports = require("module");;
/***/ }), /***/ }),
@@ -3863,7 +3863,7 @@ module.exports = require("module");
/***/ ((module) => { /***/ ((module) => {
"use strict"; "use strict";
module.exports = require("path"); module.exports = require("path");;
/***/ }) /***/ })
+38 -38
View File
@@ -1785,9 +1785,9 @@
"dev": true "dev": true
}, },
"@types/node": { "@types/node": {
"version": "14.14.6", "version": "14.14.7",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.6.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.7.tgz",
"integrity": "sha512-6QlRuqsQ/Ox/aJEQWBEJG7A9+u7oSYl3mem/K8IzxXG/kAGbV1YPD9Bg9Zw3vyxC/YP+zONKwy8hGkSt1jxFMw==" "integrity": "sha512-Zw1vhUSQZYw+7u5dAwNbIA9TuTotpzY/OF7sJM9FqPOF3SPjKnxrjoTktXDZgUjybf4cWVBP7O8wvKdSaGHweg=="
}, },
"@types/normalize-package-data": { "@types/normalize-package-data": {
"version": "2.4.0", "version": "2.4.0",
@@ -1894,25 +1894,25 @@
} }
}, },
"@typescript-eslint/parser": { "@typescript-eslint/parser": {
"version": "4.6.1", "version": "4.7.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.6.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.7.0.tgz",
"integrity": "sha512-lScKRPt1wM9UwyKkGKyQDqf0bh6jm8DQ5iN37urRIXDm16GEv+HGEmum2Fc423xlk5NUOkOpfTnKZc/tqKZkDQ==", "integrity": "sha512-+meGV8bMP1sJHBI2AFq1GeTwofcGiur8LoIr6v+rEmD9knyCqDlrQcFHR0KDDfldHIFDU/enZ53fla6ReF4wRw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/scope-manager": "4.6.1", "@typescript-eslint/scope-manager": "4.7.0",
"@typescript-eslint/types": "4.6.1", "@typescript-eslint/types": "4.7.0",
"@typescript-eslint/typescript-estree": "4.6.1", "@typescript-eslint/typescript-estree": "4.7.0",
"debug": "^4.1.1" "debug": "^4.1.1"
}, },
"dependencies": { "dependencies": {
"@typescript-eslint/scope-manager": { "@typescript-eslint/scope-manager": {
"version": "4.6.1", "version": "4.7.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.6.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.7.0.tgz",
"integrity": "sha512-f95+80r6VdINYscJY1KDUEDcxZ3prAWHulL4qRDfNVD0I5QAVSGqFkwHERDoLYJJWmEAkUMdQVvx7/c2Hp+Bjg==", "integrity": "sha512-ILITvqwDJYbcDCROj6+Ob0oCKNg3SH46iWcNcTIT9B5aiVssoTYkhKjxOMNzR1F7WSJkik4zmuqve5MdnA0DyA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/types": "4.6.1", "@typescript-eslint/types": "4.7.0",
"@typescript-eslint/visitor-keys": "4.6.1" "@typescript-eslint/visitor-keys": "4.7.0"
} }
} }
} }
@@ -1952,19 +1952,19 @@
} }
}, },
"@typescript-eslint/types": { "@typescript-eslint/types": {
"version": "4.6.1", "version": "4.7.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.6.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.7.0.tgz",
"integrity": "sha512-k2ZCHhJ96YZyPIsykickez+OMHkz06xppVLfJ+DY90i532/Cx2Z+HiRMH8YZQo7a4zVd/TwNBuRCdXlGK4yo8w==", "integrity": "sha512-uLszFe0wExJc+I7q0Z/+BnP7wao/kzX0hB5vJn4LIgrfrMLgnB2UXoReV19lkJQS1a1mHWGGODSxnBx6JQC3Sg==",
"dev": true "dev": true
}, },
"@typescript-eslint/typescript-estree": { "@typescript-eslint/typescript-estree": {
"version": "4.6.1", "version": "4.7.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.6.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.7.0.tgz",
"integrity": "sha512-/J/kxiyjQQKqEr5kuKLNQ1Finpfb8gf/NpbwqFFYEBjxOsZ621r9AqwS9UDRA1Rrr/eneX/YsbPAIhU2rFLjXQ==", "integrity": "sha512-5XZRQznD1MfUmxu1t8/j2Af4OxbA7EFU2rbo0No7meb46eHgGkSieFdfV6omiC/DGIBhH9H9gXn7okBbVOm8jw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/types": "4.6.1", "@typescript-eslint/types": "4.7.0",
"@typescript-eslint/visitor-keys": "4.6.1", "@typescript-eslint/visitor-keys": "4.7.0",
"debug": "^4.1.1", "debug": "^4.1.1",
"globby": "^11.0.1", "globby": "^11.0.1",
"is-glob": "^4.0.1", "is-glob": "^4.0.1",
@@ -1974,12 +1974,12 @@
} }
}, },
"@typescript-eslint/visitor-keys": { "@typescript-eslint/visitor-keys": {
"version": "4.6.1", "version": "4.7.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.6.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.7.0.tgz",
"integrity": "sha512-owABze4toX7QXwOLT3/D5a8NecZEjEWU1srqxENTfqsY3bwVnl3YYbOh6s1rp2wQKO9RTHFGjKes08FgE7SVMw==", "integrity": "sha512-aDJDWuCRsf1lXOtignlfiPODkzSxxop7D0rZ91L6ZuMlcMCSh0YyK+gAfo5zN/ih6WxMwhoXgJWC3cWQdaKC+A==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/types": "4.6.1", "@typescript-eslint/types": "4.7.0",
"eslint-visitor-keys": "^2.0.0" "eslint-visitor-keys": "^2.0.0"
}, },
"dependencies": { "dependencies": {
@@ -1992,9 +1992,9 @@
} }
}, },
"@vercel/ncc": { "@vercel/ncc": {
"version": "0.24.1", "version": "0.25.1",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.24.1.tgz", "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.25.1.tgz",
"integrity": "sha512-r9m7brz2hNmq5TF3sxrK4qR/FhXn44XIMglQUir4sT7Sh5GOaYXlMYikHFwJStf8rmQGTlvOoBXt4yHVonRG8A==", "integrity": "sha512-dGecC5+1wLof1MQpey4+6i2KZv4Sfs6WfXkl9KfO32GED4ZPiKxRfvtGPjbjZv0IbqMl6CxtcV1RotXYfd5SSA==",
"dev": true "dev": true
}, },
"abab": { "abab": {
@@ -3107,9 +3107,9 @@
} }
}, },
"eslint": { "eslint": {
"version": "7.12.1", "version": "7.13.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-7.12.1.tgz", "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.13.0.tgz",
"integrity": "sha512-HlMTEdr/LicJfN08LB3nM1rRYliDXOmfoO4vj39xN6BLpFzF00hbwBoqHk8UcJ2M/3nlARZWy/mslvGEuZFvsg==", "integrity": "sha512-uCORMuOO8tUzJmsdRtrvcGq5qposf7Rw0LwkTJkoDbOycVQtQjmnhZSuLQnozLE4TmAzlMVV45eCHmQ1OpDKUQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/code-frame": "^7.0.0", "@babel/code-frame": "^7.0.0",
@@ -4862,9 +4862,9 @@
"dev": true "dev": true
}, },
"import-fresh": { "import-fresh": {
"version": "3.2.1", "version": "3.2.2",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.2.tgz",
"integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", "integrity": "sha512-cTPNrlvJT6twpYy+YmKUKrTSjWFs3bjYjAhCwm+z4EOCubZxAuO+hHpRN64TqjEaYSHs7tJAE0w1CKMGmsG/lw==",
"dev": true, "dev": true,
"requires": { "requires": {
"parent-module": "^1.0.0", "parent-module": "^1.0.0",
@@ -9436,9 +9436,9 @@
"dev": true "dev": true
}, },
"v8-compile-cache": { "v8-compile-cache": {
"version": "2.1.1", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz",
"integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==", "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==",
"dev": true "dev": true
}, },
"validate-npm-package-license": { "validate-npm-package-license": {
+4 -4
View File
@@ -42,10 +42,10 @@
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^26.0.15", "@types/jest": "^26.0.15",
"@types/node": "^14.14.6", "@types/node": "^14.14.7",
"@typescript-eslint/parser": "^4.6.1", "@typescript-eslint/parser": "^4.7.0",
"@vercel/ncc": "^0.24.1", "@vercel/ncc": "^0.25.1",
"eslint": "^7.12.1", "eslint": "^7.13.0",
"eslint-plugin-github": "^4.1.1", "eslint-plugin-github": "^4.1.1",
"eslint-plugin-jest": "^24.1.0", "eslint-plugin-jest": "^24.1.0",
"jest": "^24.9.0", "jest": "^24.9.0",
+1 -1
View File
@@ -50,7 +50,7 @@ export const DefaultConfiguration: Configuration = {
labels: ['test'] labels: ['test']
} }
], // the categories to support for the ordering ], // the categories to support for the ordering
ignore_labels: [ "ignore" ], // list of lables being ignored from the changelog ignore_labels: ['ignore'], // list of lables being ignored from the changelog
transformers: [], // transformers to apply on the PR description according to the `pr_template` transformers: [], // transformers to apply on the PR description according to the `pr_template`
tag_resolver: { tag_resolver: {
// defines the logic on how to resolve the previous tag, only relevant if `fromTag` is not specified // defines the logic on how to resolve the previous tag, only relevant if `fromTag` is not specified
+9 -2
View File
@@ -110,7 +110,11 @@ export function sortTags(tags: TagInfo[], tagResolver: TagResolver): TagInfo[] {
function semVerSorting(tags: TagInfo[]): TagInfo[] { function semVerSorting(tags: TagInfo[]): TagInfo[] {
// filter out tags which do not follow semver // filter out tags which do not follow semver
const validatedTags = tags.filter(tag => { const validatedTags = tags.filter(tag => {
const isValid = semver.valid(tag.name) !== null const isValid =
semver.valid(tag.name, {
includePrerelease: true,
loose: true
}) !== null
if (!isValid) { if (!isValid) {
core.debug( core.debug(
`⚠️ dropped tag ${tag.name} because it is not a valid semver tag` `⚠️ dropped tag ${tag.name} because it is not a valid semver tag`
@@ -121,7 +125,10 @@ function semVerSorting(tags: TagInfo[]): TagInfo[] {
// sort using semver // sort using semver
validatedTags.sort((b, a) => { validatedTags.sort((b, a) => {
return new SemVer(a.name).compare(b.name) return new SemVer(a.name, {
includePrerelease: true,
loose: true
}).compare(b.name)
}) })
return validatedTags return validatedTags
} }
+5 -6
View File
@@ -42,12 +42,13 @@ export function buildChangelog(
// bring PRs into the order of categories // bring PRs into the order of categories
const categorized = new Map<Category, string[]>() const categorized = new Map<Category, string[]>()
const categories = config.categories || DefaultConfiguration.categories const categories = config.categories || DefaultConfiguration.categories
const ignoredLabels = config.ignore_labels || DefaultConfiguration.ignore_labels const ignoredLabels =
config.ignore_labels || DefaultConfiguration.ignore_labels
for (const category of categories) { for (const category of categories) {
categorized.set(category, []) categorized.set(category, [])
} }
const categorizedPrs: string[] = [] const categorizedPrs: string[] = []
const ignoredPrs: string[] = [] const ignoredPrs: string[] = []
const uncategorizedPrs: string[] = [] const uncategorizedPrs: string[] = []
@@ -111,9 +112,7 @@ export function buildChangelog(
for (const pr of ignoredPrs) { for (const pr of ignoredPrs) {
changelogIgnored = `${changelogIgnored + pr}\n` changelogIgnored = `${changelogIgnored + pr}\n`
} }
core.info( core.info(`✒️ Wrote ${ignoredPrs.length} ignored pull requests down`)
`✒️ Wrote ${ignoredPrs.length} ignored pull requests down`
)
// fill template // fill template
let transformedChangelog = config.template || DefaultConfiguration.template let transformedChangelog = config.template || DefaultConfiguration.template