feat: add release-name-prefix input

Signed-off-by: Ardalan Amini <[email protected]>
This commit is contained in:
Ardalan Amini committed 2023-04-30 13:16:42 +03:30
1 parent c55ed3a9be
commit 5df3903892
8 files changed
+60 -5

No files matched your search

+16
View File
@@ -12,6 +12,7 @@ Automatic Changelog generator
- [Commit Types](#commit-types)
- [Default Commit Type](#default-commit-type)
- [Release Name](#release-name)
- [Release Name Prefix](#release-name-prefix)
- [Mention Authors](#mention-authors)
- [Mention New Contributors](#mention-new-contributors)
- [Include GitHub Compare Link](#include-compare-link)
@@ -111,6 +112,20 @@ _Default:_
${{ github.ref_name }}
```
#### `release-name-prefix`
**(Optional)**
Release name (version) prefix.
> Example: For a release name such as `@actions/github/v1.0.0` it would be `@actions/github/`
_Default:_
```yaml
""
```
#### `mention-authors`
**(Optional)**
@@ -255,6 +270,7 @@ Using with custom inputs:
revert: Reverts
default-commit-type: Other Changes
release-name: v1.0.0
release-name-prefix: ""
mention-authors: true
mention-new-contributors: true
include-compare-link: true
+5
View File
@@ -41,6 +41,11 @@ inputs:
required: true
default: ${{ github.ref_name }}
release-name-prefix:
description: Release name (version) prefix
required: true
default: ""
mention-authors:
description: Mention the author of each commit
required: true
+1 -1
View File
@@ -1,4 +1,4 @@
require('./sourcemap-register.js');(()=>{var __webpack_modules__={1932:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.generateChangelog=void 0;const s=a(7733);const r=a(9034);function trim(e){if(e==null)return e;return e.trim().replace(/ {2,}/g," ")}function unique(e){return[...new Set(e)]}function sortBy(e,t){return e.sort(((e,a)=>e[t].localeCompare(a[t])))}async function generateChangelog(e){const{paginate:t,rest:a}=(0,r.octokit)();const{owner:i,repo:p,url:n}=(0,r.repository)();const o=(0,r.defaultCommitType)();const d=(0,r.commitTypes)();const l=(0,r.includePRLinks)();const u=(0,r.includeCommitLinks)();const m=(0,r.mentionAuthors)();const c=(0,r.useGithubAutolink)();const h=t.iterator(a.repos.listCommits,{per_page:100,sha:(0,r.sha)(),owner:i,repo:p});const v=[];e:for await(const{data:t}of h){for(const a of t){if(a.sha===e)break e;const t=a.commit.message.split("\n")[0];(0,s.debug)(`commit message -> ${t}`);let{type:i,scope:p,description:h,pr:g,flag:w,breaking:y}=(0,r.parseCommitMessage)(t);if(!h)continue;h=trim(h);w=trim(w);if(w==="ignore")continue;i=d[trim(i??"")]??o;let E=v.find((e=>e.type===i));if(E==null){E={type:i,scopes:[]};v.push(E)}p=trim(p??"");let b=E.scopes.find((e=>e.scope===p));if(b==null){b={scope:p,logs:[]};E.scopes.push(b)}let _=b.logs.find((e=>e.description===h));if(_==null){_={breaking:y,description:h,references:[]};b.logs.push(_)}const D=[];if(g&&l)D.push(c?`#${g}`:`[#${g}](${n}/issues/${g})`);else if(u)D.push(c?a.sha:`\`[${a.sha}](${n}/commit/${a.sha})\``);const T=a.author?.login;if(T&&m){const e=`by @${T}`;D.push(e);const t=_.references[_.references.length-1];if(t?.endsWith(e)){_.references.push(_.references.pop().replace(e,`& ${D.join(" ")}`));continue}}if(D.length>0)_.references.push(D.join(" "))}}const g=unique(Object.values(d).concat(o));const w=[];for(const e of g){const t=v.find((t=>t.type===e));if(t==null)continue;w.push(`## ${e}`);sortBy(t.scopes,"scope");for(const{scope:e,logs:a}of t.scopes){let t="";if(e.length>0){w.push(`* **${e}:**`);t=" "}for(const{breaking:e,description:s,references:r}of a){let a=`${t}* ${e?"***breaking:*** ":""}${s}`;if(r.length>0)a+=` (${r.join(", ")})`;w.push(a)}}w.push("")}return w.join("\n")}t.generateChangelog=generateChangelog},8251:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.generateFooter=void 0;const s=a(9206);const r=a(9034);async function generateFooter(e){const{owner:t,repo:a,url:i}=(0,r.repository)();const p=(0,r.releaseName)();const n=[];if((0,r.mentionNewContributors)()){const{rest:i}=(0,r.octokit)();const{data:o}=await i.repos.generateReleaseNotes({owner:t,repo:a,tag_name:p,previous_tag_name:e});const d=s.marked.lexer(o.body);const l=d.findIndex((e=>e.type==="heading"&&e.text==="New Contributors"));const u=d[l+1];if(u.type==="list")n.push(`## New Contributors\n${u.raw}\n`)}if((0,r.includeCompareLink)()&&e){const t=(0,r.useGithubAutolink)()?`${i}/compare/${e}...${p}`:`\`[${e}...${p}](${i}/compare/${e}...${p})\``;n.push(`**Full Changelog**: ${t}`)}if(n.length>0)n.unshift("");return n.join("\n\n")}t.generateFooter=generateFooter},2263:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getTagInfo=void 0;const s=a(9034);async function getTagInfo(){const{paginate:e,rest:t}=(0,s.octokit)();const{owner:a,repo:r}=(0,s.repository)();const i={releaseId:"latest",prerelease:false};let p=null;if((0,s.semver)()){p=(0,s.parseSemVer)();if(p==null)throw new Error(`Expected a semver compatible releaseName, got "${(0,s.releaseName)()}" instead.`);i.prerelease=p.prerelease.length>0;if(i.prerelease)i.releaseId=`${p.prerelease[0]}`}const n=e.iterator(t.repos.listTags,{per_page:100,owner:a,repo:r});e:for await(const{data:e}of n){for(const{name:t,commit:a}of e){if((0,s.sha)()===a.sha)continue;if(p==null){i.previous={name:t,sha:a.sha};break e}const e=(0,s.parseSemVer)(t);if(e==null||p.compare(e)<=0)continue;if(e.prerelease.length>0&&!i.prerelease)continue;i.previous={name:t,sha:a.sha};break e}}return i}t.getTagInfo=getTagInfo},6243:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.booleanInput=void 0;const s=a(7733);const r=a(927);function booleanInput(e,t=true){return(0,r.cache)(e,(()=>(0,s.getBooleanInput)(e,{required:t})))}t.booleanInput=booleanInput},927:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.cache=void 0;const a=new Map;function cache(e,t,s=false){if(!a.has(e)||s)a.set(e,t());return a.get(e)}t.cache=cache},9034:function(e,t,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,a,s){if(s===undefined)s=a;var r=Object.getOwnPropertyDescriptor(t,a);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[a]}}}Object.defineProperty(e,s,r)}:function(e,t,a,s){if(s===undefined)s=a;e[s]=t[a]});var r=this&&this.__exportStar||function(e,t){for(var a in e)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(t,a))s(t,e,a)};Object.defineProperty(t,"__eLine truncated
require('./sourcemap-register.js');(()=>{var __webpack_modules__={1932:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.generateChangelog=void 0;const s=a(7733);const r=a(9034);function trim(e){if(e==null)return e;return e.trim().replace(/ {2,}/g," ")}function unique(e){return[...new Set(e)]}function sortBy(e,t){return e.sort(((e,a)=>e[t].localeCompare(a[t])))}async function generateChangelog(e){const{paginate:t,rest:a}=(0,r.octokit)();const{owner:i,repo:p,url:n}=(0,r.repository)();const o=(0,r.defaultCommitType)();const d=(0,r.commitTypes)();const l=(0,r.includePRLinks)();const u=(0,r.includeCommitLinks)();const m=(0,r.mentionAuthors)();const c=(0,r.useGithubAutolink)();const h=t.iterator(a.repos.listCommits,{per_page:100,sha:(0,r.sha)(),owner:i,repo:p});const v=[];e:for await(const{data:t}of h){for(const a of t){if(a.sha===e)break e;const t=a.commit.message.split("\n")[0];(0,s.debug)(`commit message -> ${t}`);let{type:i,scope:p,description:h,pr:g,flag:w,breaking:y}=(0,r.parseCommitMessage)(t);if(!h)continue;h=trim(h);w=trim(w);if(w==="ignore")continue;i=d[trim(i??"")]??o;let E=v.find((e=>e.type===i));if(E==null){E={type:i,scopes:[]};v.push(E)}p=trim(p??"");let b=E.scopes.find((e=>e.scope===p));if(b==null){b={scope:p,logs:[]};E.scopes.push(b)}let _=b.logs.find((e=>e.description===h));if(_==null){_={breaking:y,description:h,references:[]};b.logs.push(_)}const D=[];if(g&&l)D.push(c?`#${g}`:`[#${g}](${n}/issues/${g})`);else if(u)D.push(c?a.sha:`\`[${a.sha}](${n}/commit/${a.sha})\``);const T=a.author?.login;if(T&&m){const e=`by @${T}`;D.push(e);const t=_.references[_.references.length-1];if(t?.endsWith(e)){_.references.push(_.references.pop().replace(e,`& ${D.join(" ")}`));continue}}if(D.length>0)_.references.push(D.join(" "))}}const g=unique(Object.values(d).concat(o));const w=[];for(const e of g){const t=v.find((t=>t.type===e));if(t==null)continue;w.push(`## ${e}`);sortBy(t.scopes,"scope");for(const{scope:e,logs:a}of t.scopes){let t="";if(e.length>0){w.push(`* **${e}:**`);t=" "}for(const{breaking:e,description:s,references:r}of a){let a=`${t}* ${e?"***breaking:*** ":""}${s}`;if(r.length>0)a+=` (${r.join(", ")})`;w.push(a)}}w.push("")}return w.join("\n")}t.generateChangelog=generateChangelog},8251:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.generateFooter=void 0;const s=a(9206);const r=a(9034);async function generateFooter(e){const{owner:t,repo:a,url:i}=(0,r.repository)();const p=(0,r.releaseName)();const n=[];if((0,r.mentionNewContributors)()){const{rest:i}=(0,r.octokit)();const{data:o}=await i.repos.generateReleaseNotes({owner:t,repo:a,tag_name:p,previous_tag_name:e});const d=s.marked.lexer(o.body);const l=d.findIndex((e=>e.type==="heading"&&e.text==="New Contributors"));const u=d[l+1];if(u.type==="list")n.push(`## New Contributors\n${u.raw}\n`)}if((0,r.includeCompareLink)()&&e){let t=`${i}/compare/${e}...${p}`;if(!(0,r.useGithubAutolink)()||(0,r.releaseNamePrefix)())t=`\`[${e}...${p}](${i}/compare/${e}...${p})\``;n.push(`**Full Changelog**: ${t}`)}if(n.length>0)n.unshift("");return n.join("\n\n")}t.generateFooter=generateFooter},2263:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getTagInfo=void 0;const s=a(9034);async function getTagInfo(){const{paginate:e,rest:t}=(0,s.octokit)();const{owner:a,repo:r}=(0,s.repository)();const i={releaseId:"latest",prerelease:false};let p=null;if((0,s.semver)()){p=(0,s.parseSemVer)();if(p==null)throw new Error(`Expected a semver compatible releaseName, got "${(0,s.releaseName)()}" instead.`);i.prerelease=p.prerelease.length>0;if(i.prerelease)i.releaseId=`${p.prerelease[0]}`}const n=e.iterator(t.repos.listTags,{per_page:100,owner:a,repo:r});e:for await(const{data:e}of n){for(const{name:t,commit:a}of e){if((0,s.sha)()===a.sha)continue;if(p==null){i.previous={name:t,sha:a.sha};break e}const e=(0,s.parseSemVer)(t);if(e==null||p.compare(e)<=0)continue;if(e.prerelease.length>0&&!i.prerelease)continue;i.previous={name:t,sha:a.sha};break e}}return i}t.getTagInfo=getTagInfo},6243:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.booleanInput=void 0;const s=a(7733);const r=a(927);function booleanInput(e,t=true){return(0,r.cache)(e,(()=>(0,s.getBooleanInput)(e,{required:t})))}t.booleanInput=booleanInput},927:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.cache=void 0;const a=new Map;function cache(e,t,s=false){if(!a.has(e)||s)a.set(e,t());return a.get(e)}t.cache=cache},9034:function(e,t,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,a,s){if(s===undefined)s=a;var r=Object.getOwnPropertyDescriptor(t,a);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[a]}}}Object.defineProperty(e,s,r)}:function(e,t,a,s){if(s===undefined)s=a;e[s]=t[a]});var r=this&&this.__exportStar||function(e,t){for(var a in e)if(a!=="default"&&!Object.prototype.hasOwnProperty.call(t,a))s(t,e,aLine truncated
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
+1 -1
View File
@@ -1 +1 @@
{"version":3,"sources":["../webpack:/auto-changelog/dist/changelog.js","../webpack:/auto-changelog/dist/footer.js","../webpack:/auto-changelog/dist/tag.js","../webpack:/auto-changelog/dist/utils/boolean-input.js","../webpack:/auto-changelog/dist/utils/cache.js","../webpack:/auto-changelog/dist/utils/index.js","../webpack:/auto-changelog/dist/utils/input.js","../webpack:/auto-changelog/dist/utils/inputs/commit-types.js","../webpack:/auto-changelog/dist/utils/inputs/default-commit-type.js","../webpack:/auto-changelog/dist/utils/inputs/include-commit-links.js","../webpack:/auto-changelog/dist/utils/inputs/include-compare-link.js","../webpack:/auto-changelog/dist/utils/inputs/include-pr-links.js","../webpack:/auto-changelog/dist/utils/inputs/index.js","../webpack:/auto-changelog/dist/utils/inputs/mention-authors.js","../webpack:/auto-changelog/dist/utils/inputs/mention-new-contributors.js","../webpack:/auto-changelog/dist/utils/inputs/release-name.js","../webpack:/auto-changelog/dist/utils/inputs/semver.js","../webpack:/auto-changelog/dist/utils/inputs/token.js","../webpack:/auto-changelog/dist/utils/inputs/use-github-autolink.js","../webpack:/auto-changelog/dist/utils/octokit.js","../webpack:/auto-changelog/dist/utils/output.js","../webpack:/auto-changelog/dist/utils/outputs/index.js","../webpack:/auto-changelog/dist/utils/outputs/set-changelog.js","../webpack:/auto-changelog/dist/utils/outputs/set-prerelease.js","../webpack:/auto-changelog/dist/utils/outputs/set-release-id.js","../webpack:/auto-changelog/dist/utils/parse-commit-message.js","../webpack:/auto-changelog/dist/utils/parse-semver.js","../webpack:/auto-changelog/dist/utils/repository.js","../webpack:/auto-changelog/dist/utils/sha.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/core/lib/command.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/core/lib/core.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/core/lib/file-command.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/core/lib/oidc-utils.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/core/lib/path-utils.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/core/lib/summary.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/core/lib/utils.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/github/lib/context.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/github/lib/github.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/github/lib/internal/utils.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/github/lib/utils.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/http-client/lib/auth.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/http-client/lib/index.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/http-client/lib/proxy.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@octokit/auth-token/dist-node/index.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@octokit/core/dist-node/index.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@octokit/endpoint/dist-node/index.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@octokit/graphql/dist-node/index.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@octokit/request-error/dist-node/index.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@octokit/request/dist-node/index.js","../webpack:/auto-changelog/node_modules/.pnpm/[email protected]/node_modules/before-after-hook/index.js","../webpack:/auto-changelog/node_modules/.pnpm/[email protected]/node_modules/before-after-hook/lib/add.js","../webpack:/auto-changelog/node_modules/.pnpm/[email protected]/node_modules/before-after-hook/lib/register.js","../webpack:/auto-changelog/node_modules/.pnpm/[email protected]/node_modules/before-after-hook/lib/remove.js","../webpack:/auto-changelog/node_modules/.pnpm/[email protected]/node_modules/deprecation/dist-node/index.js","../webpack:/Line truncated
{"version":3,"sources":["../webpack:/auto-changelog/dist/changelog.js","../webpack:/auto-changelog/dist/footer.js","../webpack:/auto-changelog/dist/tag.js","../webpack:/auto-changelog/dist/utils/boolean-input.js","../webpack:/auto-changelog/dist/utils/cache.js","../webpack:/auto-changelog/dist/utils/index.js","../webpack:/auto-changelog/dist/utils/input.js","../webpack:/auto-changelog/dist/utils/inputs/commit-types.js","../webpack:/auto-changelog/dist/utils/inputs/default-commit-type.js","../webpack:/auto-changelog/dist/utils/inputs/include-commit-links.js","../webpack:/auto-changelog/dist/utils/inputs/include-compare-link.js","../webpack:/auto-changelog/dist/utils/inputs/include-pr-links.js","../webpack:/auto-changelog/dist/utils/inputs/index.js","../webpack:/auto-changelog/dist/utils/inputs/mention-authors.js","../webpack:/auto-changelog/dist/utils/inputs/mention-new-contributors.js","../webpack:/auto-changelog/dist/utils/inputs/release-name-prefix.js","../webpack:/auto-changelog/dist/utils/inputs/release-name.js","../webpack:/auto-changelog/dist/utils/inputs/semver.js","../webpack:/auto-changelog/dist/utils/inputs/token.js","../webpack:/auto-changelog/dist/utils/inputs/use-github-autolink.js","../webpack:/auto-changelog/dist/utils/octokit.js","../webpack:/auto-changelog/dist/utils/output.js","../webpack:/auto-changelog/dist/utils/outputs/index.js","../webpack:/auto-changelog/dist/utils/outputs/set-changelog.js","../webpack:/auto-changelog/dist/utils/outputs/set-prerelease.js","../webpack:/auto-changelog/dist/utils/outputs/set-release-id.js","../webpack:/auto-changelog/dist/utils/parse-commit-message.js","../webpack:/auto-changelog/dist/utils/parse-semver.js","../webpack:/auto-changelog/dist/utils/repository.js","../webpack:/auto-changelog/dist/utils/sha.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/core/lib/command.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/core/lib/core.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/core/lib/file-command.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/core/lib/oidc-utils.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/core/lib/path-utils.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/core/lib/summary.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/core/lib/utils.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/github/lib/context.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/github/lib/github.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/github/lib/internal/utils.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/github/lib/utils.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/http-client/lib/auth.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/http-client/lib/index.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@actions/http-client/lib/proxy.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@octokit/auth-token/dist-node/index.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@octokit/core/dist-node/index.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@octokit/endpoint/dist-node/index.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@octokit/graphql/dist-node/index.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@octokit/request-error/dist-node/index.js","../webpack:/auto-changelog/node_modules/.pnpm/@[email protected]/node_modules/@octokit/request/dist-node/index.js","../webpack:/auto-changelog/node_modules/.pnpm/[email protected]/node_modules/before-after-hook/index.js","../webpack:/auto-changelog/node_modules/.pnpm/[email protected]/node_modules/before-after-hook/lib/add.js","../webpack:/auto-changelog/node_modules/.pnpm/[email protected]/node_modules/before-after-hook/lib/register.js","../webpack:/auto-changelog/node_modules/.pnpm/[email protected]/node_modules/before-after-hook/lib/remove.js","../webpack:/auto-changelog/node_modules/.pnpm/deprecLine truncated
+4 -1
View File
@@ -29,6 +29,7 @@ import {
mentionNewContributors,
octokit,
releaseName,
releaseNamePrefix,
repository,
useGithubAutolink,
} from "./utils/index.js";
@@ -61,7 +62,9 @@ export async function generateFooter(previousTagName?: string): Promise<string>
}
if (includeCompareLink() && previousTagName) {
const link = useGithubAutolink() ? `${ url }/compare/${ previousTagName }...${ tagName }` : `\`[${ previousTagName }...${ tagName }](${ url }/compare/${ previousTagName }...${ tagName })\``;
let link = `${ url }/compare/${ previousTagName }...${ tagName }`;
if (!useGithubAutolink() || releaseNamePrefix()) link = `\`[${ previousTagName }...${ tagName }](${ url }/compare/${ previousTagName }...${ tagName })\``;
footer.push(`**Full Changelog**: ${ link }`);
}
+1
View File
@@ -31,6 +31,7 @@ export * from "./include-pr-links.js";
export * from "./mention-authors.js";
export * from "./mention-new-contributors.js";
export * from "./release-name.js";
export * from "./release-name-prefix.js";
export * from "./semver.js";
export * from "./token.js";
export * from "./use-github-autolink.js";
+30
View File
@@ -0,0 +1,30 @@
/*
* MIT License
*
* Copyright (c) 2023 Ardalan Amini
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
import { input } from "../input.js";
export function releaseNamePrefix(): string {
return input("release-name-prefix");
}
+2 -2
View File
@@ -25,10 +25,10 @@
import { parse, type SemVer } from "semver";
import { cache } from "./cache.js";
import { releaseName } from "./inputs/index.js";
import { releaseName, releaseNamePrefix } from "./inputs/index.js";
export function parseSemVer(version = releaseName()): SemVer | null {
return cache(`semver-${ version }`, () => parse(version, { includePrerelease: true } as never));
return cache(`semver-${ version }`, () => parse(version.replace(new RegExp(`^${ releaseNamePrefix() }`), ""), { includePrerelease: true } as never));
}
export { SemVer };