mirror of
https://github.com/darksaid98/auto-changelog.git
synced 2026-12-01 14:38:47 +00:00
feat!: add use-github-autolink input
Signed-off-by: Ardalan Amini <[email protected]>
This commit is contained in:
8 files changed
+69
-13
No files matched your search
@@ -16,6 +16,7 @@ Automatic Changelog generator
|
||||
- [Mention New Contributors](#mention-new-contributors)
|
||||
- [Include GitHub Compare Link](#include-compare-link)
|
||||
- [SemVer Compatibility](#semver)
|
||||
- [Use GitHub Autolink](#use-github-autolink)
|
||||
- [Outputs](#outputs)
|
||||
- [Changelog](#changelog)
|
||||
- [Pre-release](#prerelease)
|
||||
@@ -193,6 +194,18 @@ _Default:_
|
||||
true
|
||||
```
|
||||
|
||||
#### `use-github-autolink`
|
||||
|
||||
**(Optional)**
|
||||
|
||||
Use [GitHub Autolink](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/autolinked-references-and-urls).
|
||||
|
||||
_Default:_
|
||||
|
||||
```yaml
|
||||
true
|
||||
```
|
||||
|
||||
### Outputs
|
||||
|
||||
#### `changelog`
|
||||
@@ -252,4 +265,5 @@ Using with custom inputs:
|
||||
include-pr-lints: true
|
||||
include-commit-lints: true
|
||||
semver: true
|
||||
use-github-autolink: true
|
||||
```
|
||||
@@ -74,6 +74,11 @@ inputs:
|
||||
required: true
|
||||
default: 'true'
|
||||
|
||||
use-github-autolink:
|
||||
description: Use GitHub Autolink
|
||||
required: true
|
||||
default: 'true'
|
||||
|
||||
outputs:
|
||||
|
||||
changelog:
|
||||
|
||||
+1
-1
@@ -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=t.iterator(a.repos.listCommits,{per_page:100,sha:(0,r.sha)(),owner:i,repo:p});const h=[];e:for await(const{data:t}of c){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:c,pr:v,flag:g}=(0,r.parseCommitMessage)(t);if(!c)continue;c=trim(c);g=trim(g);if(g==="ignore")continue;i=d[trim(i??"")]??o;let w=h.find((e=>e.type===i));if(w==null){w={type:i,scopes:[]};h.push(w)}p=trim(p??"");let y=w.scopes.find((e=>e.scope===p));if(y==null){y={scope:p,logs:[]};w.scopes.push(y)}let E=y.logs.find((e=>e.description===c));if(E==null){E={description:c,references:[]};y.logs.push(E)}const b=[];if(v&&l)b.push(`${n}/issues/${v}`);if((!v||!l)&&u)b.push(`${n}/commit/${a.sha}`);if(a.author?.login&&m)b.push(`by @${a.author.login}`);if(b.length>0)E.references.push(b.join(" "))}}const v=unique(Object.values(d).concat(o));const g=[];for(const e of v){const t=h.find((t=>t.type===e));if(t==null)continue;g.push(`## ${e}`);sortBy(t.scopes,"scope");for(const{scope:e,logs:a}of t.scopes){let t="";if(e.length>0){g.push(`* **${e}:**`);t=" "}for(const{description:e,references:s}of a){let a=`${t}* ${e}`;if(s.length>0)a+=` (${s.join(", ")})`;g.push(a)}}g.push("")}return g.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)n.push(`**Full Changelog**: ${i}/compare/${e}...${p}`);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,"__esModule",{value:true});r(a(8714),t);r(a(2435),t);r(a(6243),t);r(a(927),t);r(a(7557),t);r(a(1810),t);r(a(9839),t);r(a(3954),t);r(a(2574),t);r(a(615),t);r(a(3648),t)},7557:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.input=void 0;const s=a(7733);const r=a(927);function input(e,t=(e=>e),a=true){return(0,r.cache)(e,(()=>t((0,s.getInput)(e,Line 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}=(0,r.parseCommitMessage)(t);if(!h)continue;h=trim(h);w=trim(w);if(w==="ignore")continue;i=d[trim(i??"")]??o;let y=v.find((e=>e.type===i));if(y==null){y={type:i,scopes:[]};v.push(y)}p=trim(p??"");let E=y.scopes.find((e=>e.scope===p));if(E==null){E={scope:p,logs:[]};y.scopes.push(E)}let b=E.logs.find((e=>e.description===h));if(b==null){b={description:h,references:[]};E.logs.push(b)}const _=[];if(g&&l)_.push(c?`#${g}`:`[#${g}](${n}/issues/${g})`);if((!g||!l)&&u)_.push(c?a.sha:`\`[${a.sha}](${n}/commit/${a.sha})\``);if(a.author?.login&&m)_.push(`by @${a.author.login}`);if(_.length>0)b.references.push(_.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{description:e,references:s}of a){let a=`${t}* ${e}`;if(s.length>0)a+=` (${s.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,"__esModule",{value:true});r(a(8714),t);r(a(2435),t);r(a(6243),t);r(a(927),t);r(a(7557),t);r(a(1810),t);r(a(9839),t);r(a(3954),t);r(a(2574),t);r(a(615),t);r(a(3648),t)},7557:(e,t,a)=>{"use strict";Object.defLine truncated
|
||||
/*!
|
||||
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
||||
*
|
||||
|
||||
+1
-1
@@ -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/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:/auto-changelog/node_modules/.pnpm/[email protected]/node_modules/iLine 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.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
|
||||
+4
-9
@@ -34,6 +34,7 @@ import {
|
||||
parseCommitMessage,
|
||||
repository,
|
||||
sha,
|
||||
useGithubAutolink,
|
||||
} from "./utils/index.js";
|
||||
|
||||
interface TypeGroupI {
|
||||
@@ -74,6 +75,7 @@ export async function generateChangelog(lastSha?: string): Promise<string> {
|
||||
const shouldIncludePRLinks = includePRLinks();
|
||||
const shouldIncludeCommitLinks = includeCommitLinks();
|
||||
const shouldMentionAuthors = mentionAuthors();
|
||||
const shouldUseGithubAutolink = useGithubAutolink();
|
||||
|
||||
const iterator = paginate.iterator(
|
||||
rest.repos.listCommits,
|
||||
@@ -145,9 +147,9 @@ export async function generateChangelog(lastSha?: string): Promise<string> {
|
||||
|
||||
const reference: string[] = [];
|
||||
|
||||
if (pr && shouldIncludePRLinks) reference.push(`${ url }/issues/${ pr }`);
|
||||
if (pr && shouldIncludePRLinks) reference.push(shouldUseGithubAutolink ? `#${ pr }` : `[#${ pr }](${ url }/issues/${ pr })`);
|
||||
|
||||
if ((!pr || !shouldIncludePRLinks) && shouldIncludeCommitLinks) reference.push(`${ url }/commit/${ commit.sha }`);
|
||||
if ((!pr || !shouldIncludePRLinks) && shouldIncludeCommitLinks) reference.push(shouldUseGithubAutolink ? commit.sha : `\`[${ commit.sha }](${ url }/commit/${ commit.sha })\``);
|
||||
|
||||
if (commit.author?.login && shouldMentionAuthors) reference.push(`by @${ commit.author.login }`);
|
||||
|
||||
@@ -191,10 +193,3 @@ export async function generateChangelog(lastSha?: string): Promise<string> {
|
||||
|
||||
return changelog.join("\n");
|
||||
}
|
||||
|
||||
export interface ChangelogRecordI {
|
||||
description: string;
|
||||
references: string[];
|
||||
scope: string;
|
||||
type: string;
|
||||
}
|
||||
+13
-2
@@ -24,7 +24,14 @@
|
||||
*/
|
||||
|
||||
import { marked } from "marked";
|
||||
import { includeCompareLink, mentionNewContributors, octokit, releaseName, repository } from "./utils/index.js";
|
||||
import {
|
||||
includeCompareLink,
|
||||
mentionNewContributors,
|
||||
octokit,
|
||||
releaseName,
|
||||
repository,
|
||||
useGithubAutolink,
|
||||
} from "./utils/index.js";
|
||||
|
||||
export async function generateFooter(previousTagName?: string): Promise<string> {
|
||||
const { owner, repo, url } = repository();
|
||||
@@ -53,7 +60,11 @@ export async function generateFooter(previousTagName?: string): Promise<string>
|
||||
if (markdownToken.type === "list") footer.push(`## New Contributors\n${ markdownToken.raw }\n`);
|
||||
}
|
||||
|
||||
if (includeCompareLink() && previousTagName) footer.push(`**Full Changelog**: ${ url }/compare/${ previousTagName }...${ tagName }`);
|
||||
if (includeCompareLink() && previousTagName) {
|
||||
const link = useGithubAutolink() ? `${ url }/compare/${ previousTagName }...${ tagName }` : `\`[${ previousTagName }...${ tagName }](${ url }/compare/${ previousTagName }...${ tagName })\``;
|
||||
|
||||
footer.push(`**Full Changelog**: ${ link }`);
|
||||
}
|
||||
|
||||
if (footer.length > 0) footer.unshift("");
|
||||
|
||||
|
||||
@@ -33,3 +33,4 @@ export * from "./mention-new-contributors.js";
|
||||
export * from "./release-name.js";
|
||||
export * from "./semver.js";
|
||||
export * from "./token.js";
|
||||
export * from "./use-github-autolink.js";
|
||||
@@ -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 { booleanInput } from "../boolean-input.js";
|
||||
|
||||
export function useGithubAutolink(): boolean {
|
||||
return booleanInput("use-github-autolink");
|
||||
}
|
||||
Reference in new issue
Block a user