mirror of
https://github.com/darksaid98/auto-changelog.git
synced 2026-12-01 14:38:47 +00:00
fix: Changelog containing commits after the current tag (#7)
This commit is contained in:
4 files changed
+28
-14
No files matched your search
+1
-1
@@ -1,4 +1,4 @@
|
||||
require('./sourcemap-register.js');(()=>{var __webpack_modules__={7412:function(e,p){"use strict";var a=this&&this.__awaiter||function(e,p,a,d){function adopt(e){return e instanceof a?e:new a((function(p){p(e)}))}return new(a||(a=Promise))((function(a,t){function fulfilled(e){try{step(d.next(e))}catch(e){t(e)}}function rejected(e){try{step(d["throw"](e))}catch(e){t(e)}}function step(e){e.done?a(e.value):adopt(e.value).then(fulfilled,rejected)}step((d=d.apply(e,p||[])).next())}))};var d=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var p=e[Symbol.asyncIterator],a;return p?p.call(e):(e=typeof __values==="function"?__values(e):e[Symbol.iterator](),a={},verb("next"),verb("throw"),verb("return"),a[Symbol.asyncIterator]=function(){return this},a);function verb(p){a[p]=e[p]&&function(a){return new Promise((function(d,t){a=e[p](a),settle(d,t,a.done,a.value)}))}}function settle(e,p,a,d){Promise.resolve(d).then((function(p){e({value:p,done:a})}),p)}};var t=this&&this.__rest||function(e,p){var a={};for(var d in e)if(Object.prototype.hasOwnProperty.call(e,d)&&p.indexOf(d)<0)a[d]=e[d];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var t=0,d=Object.getOwnPropertySymbols(e);t<d.length;t++){if(p.indexOf(d[t])<0&&Object.prototype.propertyIsEnumerable.call(e,d[t]))a[d[t]]=e[d[t]]}return a};Object.defineProperty(p,"__esModule",{value:true});p.generate=void 0;function generate(e,p,o,m,l){var n,u;var c,v,h;return a(this,void 0,void 0,(function*(){p=p.map((e=>{var p;return(p=s[e])!==null&&p!==void 0?p:e}));const a=`https://github.com/${o}/${m}`;const w={};try{e:for(var g=d(e.paginate.iterator(e.rest.repos.listCommits,{per_page:100,owner:o,repo:m})),T;T=yield g.next(),!T.done;){const{data:e}=T.value;for(let p of e){const{sha:e}=p,d=t(p,["sha"]);if(e===l)break e;const o=d.commit.message.split("\n")[0];let[,m,n,u,g]=r.exec(o)||[];if(!u)continue;g=trim(g);if(g==="ignore")continue;m=trim(m);m=(c=s[m])!==null&&c!==void 0?c:s.other;n=n?trim(n):"";u=trim(u).replace(i,((e,p)=>`[${e}](${a}/pull/${p})`));w[m]=(v=w[m])!==null&&v!==void 0?v:{};w[m][n]=(h=w[m][n])!==null&&h!==void 0?h:[];const T=w[m][n].findIndex((e=>e.title===u));if(T===-1)w[m][n].push({title:u,commits:[e]});else w[m][n][T].commits.push(e)}}}catch(e){n={error:e}}finally{try{if(T&&!T.done&&(u=g.return))yield u.call(g)}finally{if(n)throw n.error}}return Object.values(s).filter((e=>!p.includes(e))).sort().reduce(((e,p)=>{const d=w[p];if(d==null)return e;e.push(`### ${p}`,"");const t=Object.keys(d).sort();for(const p of t){const t=d[p];const r=p.length===0;if(!r)e.push(`* **${p}:**`);const i=r?"":" ";for(const{title:p,commits:d}of t){e.push(`${i}* ${p} (${d.map((e=>`[${e.slice(0,8)}](${a}/commit/${e})`)).join(",")})`)}}e.push("");return e}),[]).join("\n")}))}p.generate=generate;function trim(e){if(e==null)return e;return e.trim().replace(/ {2,}/g," ")}const r=/^([^)]*)(?:\(([^)]*?)\)|):(.*?)(?:\[([^\]]+?)\]|)\s*$/;const i=/#([1-9]\d*)/g;const s={breaking:"Breaking Changes",build:"Build System",ci:"Continuous Integration",chore:"Chores",deps:"Dependencies",docs:"Documentation Changes",feat:"New Features",fix:"Bug Fixes",other:"Other Changes",perf:"Performance Improvements",refactor:"Refactors",revert:"Reverts",style:"Code Style Changes",test:"Tests"}},9283:function(e,p,a){"use strict";var d=this&&this.__awaiter||function(e,p,a,d){function adopt(e){return e instanceof a?e:new a((function(p){p(e)}))}return new(a||(a=Promise))((function(a,t){function fulfilled(e){try{step(d.next(e))}catch(e){t(e)}}function rejected(e){try{step(d["throw"](e))}catch(e){t(e)}}function step(e){e.done?a(e.value):adopt(e.value).then(fulfilled,rejected)}step((d=d.apply(e,p||[])).next())}))};Object.defineProperty(p,"__esModule",{value:true});const t=a(2186);const r=a(5438);const i=a(7412);function run(){return d(this,void 0,void 0,(function*(){const e=(0,t.getInput)("token",{required:true});const p=(0,t.getInput)("exclude",{required:false}).split(",");const a=(0,r.getOctokit)(e);const{repo:{owner:d,repo:s},sha:o}=r.context;const{data:m}=yield a.rest.repos.listTags({owner:d,repo:s,per_page:2});let l;if(m.length>0){if(o===m[0].commit.sha){if(m.length>1)l=m[1].commit.sha}else l=m[0].commit.sha}const n=yield(0,i.generate)(a,p,d,s,l);(0,t.info)(n);(0,t.setOutput)("changelog",n)}))}run().catch((e=>(0,t.setFailed)(e.message)))},7351:function(e,p,a){"use strict";var d=this&&this.__createBinding||(Object.create?function(e,p,a,d){if(d===undefined)d=a;Object.defineProperty(e,d,{enumerable:true,get:function(){return p[a]}})}:function(e,p,a,d){if(d===undefined)d=a;e[d]=p[a]});var t=this&&this.__setModuleDefault||(Object.create?function(e,p){Object.defineProperty(e,"default",{enumerable:true,value:p})}:function(e,p){e["default"]=p});var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var p={};if(e!=null)for(var a in e)if(a!=="default"&&Object.hasOwnProperty.call(e,a))d(p,e,a);t(p,e);return p};Object.definePLine truncated
|
||||
require('./sourcemap-register.js');(()=>{var __webpack_modules__={7412:function(e,p){"use strict";var a=this&&this.__awaiter||function(e,p,a,d){function adopt(e){return e instanceof a?e:new a((function(p){p(e)}))}return new(a||(a=Promise))((function(a,t){function fulfilled(e){try{step(d.next(e))}catch(e){t(e)}}function rejected(e){try{step(d["throw"](e))}catch(e){t(e)}}function step(e){e.done?a(e.value):adopt(e.value).then(fulfilled,rejected)}step((d=d.apply(e,p||[])).next())}))};var d=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var p=e[Symbol.asyncIterator],a;return p?p.call(e):(e=typeof __values==="function"?__values(e):e[Symbol.iterator](),a={},verb("next"),verb("throw"),verb("return"),a[Symbol.asyncIterator]=function(){return this},a);function verb(p){a[p]=e[p]&&function(a){return new Promise((function(d,t){a=e[p](a),settle(d,t,a.done,a.value)}))}}function settle(e,p,a,d){Promise.resolve(d).then((function(p){e({value:p,done:a})}),p)}};var t=this&&this.__rest||function(e,p){var a={};for(var d in e)if(Object.prototype.hasOwnProperty.call(e,d)&&p.indexOf(d)<0)a[d]=e[d];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var t=0,d=Object.getOwnPropertySymbols(e);t<d.length;t++){if(p.indexOf(d[t])<0&&Object.prototype.propertyIsEnumerable.call(e,d[t]))a[d[t]]=e[d[t]]}return a};Object.defineProperty(p,"__esModule",{value:true});p.generate=void 0;function generate(e){var p,o;var m,l,n;return a(this,void 0,void 0,(function*(){const{octokit:a,owner:u,repo:c,sha:v,tagRef:h}=e;let{exclude:w}=e;w=w.map((e=>{var p;return(p=s[e])!==null&&p!==void 0?p:e}));const g=`https://github.com/${u}/${c}`;const T={};try{e:for(var _=d(a.paginate.iterator(a.rest.repos.listCommits,{per_page:100,owner:u,repo:c,sha:v})),b;b=yield _.next(),!b.done;){const{data:e}=b.value;for(let p of e){const{sha:e}=p,a=t(p,["sha"]);if(e===h)break e;const d=a.commit.message.split("\n")[0];let[,o,u,c,v]=r.exec(d)||[];if(!c)continue;v=trim(v);if(v==="ignore")continue;o=trim(o);o=(m=s[o])!==null&&m!==void 0?m:s.other;u=u?trim(u):"";c=trim(c).replace(i,((e,p)=>`[${e}](${g}/pull/${p})`));T[o]=(l=T[o])!==null&&l!==void 0?l:{};T[o][u]=(n=T[o][u])!==null&&n!==void 0?n:[];const w=T[o][u].findIndex((e=>e.title===c));if(w===-1)T[o][u].push({title:c,commits:[e]});else T[o][u][w].commits.push(e)}}}catch(e){p={error:e}}finally{try{if(b&&!b.done&&(o=_.return))yield o.call(_)}finally{if(p)throw p.error}}return Object.values(s).filter((e=>!w.includes(e))).sort().reduce(((e,p)=>{const a=T[p];if(a==null)return e;e.push(`### ${p}`,"");const d=Object.keys(a).sort();for(const p of d){const d=a[p];const t=p.length===0;if(!t)e.push(`* **${p}:**`);const r=t?"":" ";for(const{title:p,commits:a}of d){e.push(`${r}* ${p} (${a.map((e=>`[${e.slice(0,8)}](${g}/commit/${e})`)).join(",")})`)}}e.push("");return e}),[]).join("\n")}))}p.generate=generate;function trim(e){if(e==null)return e;return e.trim().replace(/ {2,}/g," ")}const r=/^([^)]*)(?:\(([^)]*?)\)|):(.*?)(?:\[([^\]]+?)\]|)\s*$/;const i=/#([1-9]\d*)/g;const s={breaking:"Breaking Changes",build:"Build System",ci:"Continuous Integration",chore:"Chores",deps:"Dependencies",docs:"Documentation Changes",feat:"New Features",fix:"Bug Fixes",other:"Other Changes",perf:"Performance Improvements",refactor:"Refactors",revert:"Reverts",style:"Code Style Changes",test:"Tests"}},9283:function(e,p,a){"use strict";var d=this&&this.__awaiter||function(e,p,a,d){function adopt(e){return e instanceof a?e:new a((function(p){p(e)}))}return new(a||(a=Promise))((function(a,t){function fulfilled(e){try{step(d.next(e))}catch(e){t(e)}}function rejected(e){try{step(d["throw"](e))}catch(e){t(e)}}function step(e){e.done?a(e.value):adopt(e.value).then(fulfilled,rejected)}step((d=d.apply(e,p||[])).next())}))};Object.defineProperty(p,"__esModule",{value:true});const t=a(2186);const r=a(5438);const i=a(7412);function run(){return d(this,void 0,void 0,(function*(){const e=(0,t.getInput)("token",{required:true});const p=(0,t.getInput)("exclude",{required:false}).split(",");const a=(0,r.getOctokit)(e);const{repo:{owner:d,repo:s},sha:o}=r.context;const{data:m}=yield a.rest.repos.listTags({owner:d,repo:s,per_page:2});let l;if(m.length>0){if(o===m[0].commit.sha){if(m.length>1)l=m[1].commit.sha}else l=m[0].commit.sha}const n=yield(0,i.generate)({octokit:a,exclude:p,owner:d,repo:s,sha:o,tagRef:l});(0,t.info)(n);(0,t.setOutput)("changelog",n)}))}run().catch((e=>(0,t.setFailed)(e.message)))},7351:function(e,p,a){"use strict";var d=this&&this.__createBinding||(Object.create?function(e,p,a,d){if(d===undefined)d=a;Object.defineProperty(e,d,{enumerable:true,get:function(){return p[a]}})}:function(e,p,a,d){if(d===undefined)d=a;e[d]=p[a]});var t=this&&this.__setModuleDefault||(Object.create?function(e,p){Object.defineProperty(e,"default",{enumerable:true,value:p})}:function(e,p){e["default"]=p});var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var p={};if(e!=nullLine 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/index.js","../webpack:/auto-changelog/node_modules/@actions/core/lib/command.js","../webpack:/auto-changelog/node_modules/@actions/core/lib/core.js","../webpack:/auto-changelog/node_modules/@actions/core/lib/file-command.js","../webpack:/auto-changelog/node_modules/@actions/core/lib/oidc-utils.js","../webpack:/auto-changelog/node_modules/@actions/core/lib/utils.js","../webpack:/auto-changelog/node_modules/@actions/github/lib/context.js","../webpack:/auto-changelog/node_modules/@actions/github/lib/github.js","../webpack:/auto-changelog/node_modules/@actions/github/lib/internal/utils.js","../webpack:/auto-changelog/node_modules/@actions/github/lib/utils.js","../webpack:/auto-changelog/node_modules/@actions/http-client/auth.js","../webpack:/auto-changelog/node_modules/@actions/http-client/index.js","../webpack:/auto-changelog/node_modules/@actions/http-client/proxy.js","../webpack:/auto-changelog/node_modules/@octokit/auth-token/dist-node/index.js","../webpack:/auto-changelog/node_modules/@octokit/core/dist-node/index.js","../webpack:/auto-changelog/node_modules/@octokit/endpoint/dist-node/index.js","../webpack:/auto-changelog/node_modules/@octokit/graphql/dist-node/index.js","../webpack:/auto-changelog/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js","../webpack:/auto-changelog/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js","../webpack:/auto-changelog/node_modules/@octokit/request-error/dist-node/index.js","../webpack:/auto-changelog/node_modules/@octokit/request/dist-node/index.js","../webpack:/auto-changelog/node_modules/before-after-hook/index.js","../webpack:/auto-changelog/node_modules/before-after-hook/lib/add.js","../webpack:/auto-changelog/node_modules/before-after-hook/lib/register.js","../webpack:/auto-changelog/node_modules/before-after-hook/lib/remove.js","../webpack:/auto-changelog/node_modules/deprecation/dist-node/index.js","../webpack:/auto-changelog/node_modules/is-plain-object/dist/is-plain-object.js","../webpack:/auto-changelog/node_modules/node-fetch/lib/index.js","../webpack:/auto-changelog/node_modules/once/once.js","../webpack:/auto-changelog/node_modules/tr46/index.js","../webpack:/auto-changelog/node_modules/tunnel/index.js","../webpack:/auto-changelog/node_modules/tunnel/lib/tunnel.js","../webpack:/auto-changelog/node_modules/universal-user-agent/dist-node/index.js","../webpack:/auto-changelog/node_modules/webidl-conversions/lib/index.js","../webpack:/auto-changelog/node_modules/whatwg-url/lib/URL-impl.js","../webpack:/auto-changelog/node_modules/whatwg-url/lib/URL.js","../webpack:/auto-changelog/node_modules/whatwg-url/lib/public-api.js","../webpack:/auto-changelog/node_modules/whatwg-url/lib/url-state-machine.js","../webpack:/auto-changelog/node_modules/whatwg-url/lib/utils.js","../webpack:/auto-changelog/node_modules/wrappy/wrappy.js","../webpack:/auto-changelog/node_modules/@vercel/ncc/dist/ncc/@@notfound.js","../webpack:/auto-changelog/external node-commonjs \"assert\"","../webpack:/auto-changelog/external node-commonjs \"events\"","../webpack:/auto-changelog/external node-commonjs \"fs\"","../webpack:/auto-changelog/external node-commonjs \"http\"","../webpack:/auto-changelog/external node-commonjs \"https\"","../webpack:/auto-changelog/external node-commonjs \"net\"","../webpack:/auto-changelog/external node-commonjs \"os\"","../webpack:/auto-changelog/external node-commonjs \"path\"","../webpack:/auto-changelog/external node-commonjs \"punycode\"","../webpack:/auto-changelog/external node-commonjs \"stream\"","../webpack:/auto-changelog/external node-commonjs \"tls\"","../webpack:/auto-changelog/external node-commonjs \"url\"","../webpack:/auto-changelog/external node-commonjs \"util\"","../webpack:/auto-changelog/external node-commonjs \"zlib\"","../webpack:/auto-changelog/webpack/bootstrap","../webpack:/auto-changelog/webpack/runtime/compat","../webpack:/auto-changelog/webpack/startup"],"names":["__awaiter","this","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","__asyncValues","o","Symbol","asyncIterator","TypeError","m","i","call","__values","iterator","verb","n","v","settle","d","__rest","s","t","p","Object","prototype","hasOwnProperty","indexOf","getOwnPropertySymbols","length","propertyIsEnumerable","defineProperty","exports","generate","octokit","exclude","owner","repo","tagRef","e_1","_a","_b","_c","_d","map","type","TYPES","repoUrl","commits","paginator","_e","paginate","rest","repos","listCommits","per_page","_f","data","_g","sha","commit","message","split","category","title","flag","COMMIT_REGEX","exec","trim","other","replace","PR_REGEX","match","pull","existingIndex","findIndex","push","e_1_1","error","return","values","filter","includes","sort","reduce","changelog","typeGroup","categories","keys","categoryGroup","deLine truncated
|
||||
{"version":3,"sources":["../webpack:/auto-changelog/dist/changelog.js","../webpack:/auto-changelog/dist/index.js","../webpack:/auto-changelog/node_modules/@actions/core/lib/command.js","../webpack:/auto-changelog/node_modules/@actions/core/lib/core.js","../webpack:/auto-changelog/node_modules/@actions/core/lib/file-command.js","../webpack:/auto-changelog/node_modules/@actions/core/lib/oidc-utils.js","../webpack:/auto-changelog/node_modules/@actions/core/lib/utils.js","../webpack:/auto-changelog/node_modules/@actions/github/lib/context.js","../webpack:/auto-changelog/node_modules/@actions/github/lib/github.js","../webpack:/auto-changelog/node_modules/@actions/github/lib/internal/utils.js","../webpack:/auto-changelog/node_modules/@actions/github/lib/utils.js","../webpack:/auto-changelog/node_modules/@actions/http-client/auth.js","../webpack:/auto-changelog/node_modules/@actions/http-client/index.js","../webpack:/auto-changelog/node_modules/@actions/http-client/proxy.js","../webpack:/auto-changelog/node_modules/@octokit/auth-token/dist-node/index.js","../webpack:/auto-changelog/node_modules/@octokit/core/dist-node/index.js","../webpack:/auto-changelog/node_modules/@octokit/endpoint/dist-node/index.js","../webpack:/auto-changelog/node_modules/@octokit/graphql/dist-node/index.js","../webpack:/auto-changelog/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js","../webpack:/auto-changelog/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js","../webpack:/auto-changelog/node_modules/@octokit/request-error/dist-node/index.js","../webpack:/auto-changelog/node_modules/@octokit/request/dist-node/index.js","../webpack:/auto-changelog/node_modules/before-after-hook/index.js","../webpack:/auto-changelog/node_modules/before-after-hook/lib/add.js","../webpack:/auto-changelog/node_modules/before-after-hook/lib/register.js","../webpack:/auto-changelog/node_modules/before-after-hook/lib/remove.js","../webpack:/auto-changelog/node_modules/deprecation/dist-node/index.js","../webpack:/auto-changelog/node_modules/is-plain-object/dist/is-plain-object.js","../webpack:/auto-changelog/node_modules/node-fetch/lib/index.js","../webpack:/auto-changelog/node_modules/once/once.js","../webpack:/auto-changelog/node_modules/tr46/index.js","../webpack:/auto-changelog/node_modules/tunnel/index.js","../webpack:/auto-changelog/node_modules/tunnel/lib/tunnel.js","../webpack:/auto-changelog/node_modules/universal-user-agent/dist-node/index.js","../webpack:/auto-changelog/node_modules/webidl-conversions/lib/index.js","../webpack:/auto-changelog/node_modules/whatwg-url/lib/URL-impl.js","../webpack:/auto-changelog/node_modules/whatwg-url/lib/URL.js","../webpack:/auto-changelog/node_modules/whatwg-url/lib/public-api.js","../webpack:/auto-changelog/node_modules/whatwg-url/lib/url-state-machine.js","../webpack:/auto-changelog/node_modules/whatwg-url/lib/utils.js","../webpack:/auto-changelog/node_modules/wrappy/wrappy.js","../webpack:/auto-changelog/node_modules/@vercel/ncc/dist/ncc/@@notfound.js","../webpack:/auto-changelog/external node-commonjs \"assert\"","../webpack:/auto-changelog/external node-commonjs \"events\"","../webpack:/auto-changelog/external node-commonjs \"fs\"","../webpack:/auto-changelog/external node-commonjs \"http\"","../webpack:/auto-changelog/external node-commonjs \"https\"","../webpack:/auto-changelog/external node-commonjs \"net\"","../webpack:/auto-changelog/external node-commonjs \"os\"","../webpack:/auto-changelog/external node-commonjs \"path\"","../webpack:/auto-changelog/external node-commonjs \"punycode\"","../webpack:/auto-changelog/external node-commonjs \"stream\"","../webpack:/auto-changelog/external node-commonjs \"tls\"","../webpack:/auto-changelog/external node-commonjs \"url\"","../webpack:/auto-changelog/external node-commonjs \"util\"","../webpack:/auto-changelog/external node-commonjs \"zlib\"","../webpack:/auto-changelog/webpack/bootstrap","../webpack:/auto-changelog/webpack/runtime/compat","../webpack:/auto-changelog/webpack/startup"],"names":["__awaiter","this","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","__asyncValues","o","Symbol","asyncIterator","TypeError","m","i","call","__values","iterator","verb","n","v","settle","d","__rest","s","t","p","Object","prototype","hasOwnProperty","indexOf","getOwnPropertySymbols","length","propertyIsEnumerable","defineProperty","exports","generate","input","e_1","_a","_b","_c","_d","octokit","owner","repo","sha","tagRef","exclude","map","type","TYPES","repoUrl","commits","paginator","_e","paginate","rest","repos","listCommits","per_page","_f","data","_g","commit","message","split","category","title","flag","COMMIT_REGEX","exec","trim","other","replace","PR_REGEX","match","pull","existingIndex","findIndex","push","e_1_1","error","return","values","filter","includes","sort","reduce","changelog","typeGroup","categories","keys","categoryGrLine truncated
|
||||
+18
-11
@@ -1,18 +1,15 @@
|
||||
import type { GitHub } from "@actions/github/lib/utils";
|
||||
|
||||
export async function generate(
|
||||
octokit: InstanceType<typeof GitHub>,
|
||||
exclude: string[],
|
||||
owner: string,
|
||||
repo: string,
|
||||
tagRef?: string,
|
||||
): Promise<string> {
|
||||
export async function generate(input: InputI): Promise<string> {
|
||||
const { octokit, owner, repo, sha, tagRef } = input;
|
||||
let { exclude } = input;
|
||||
|
||||
exclude = exclude.map(
|
||||
(type) => (TYPES as { [type: string]: string | undefined })[type] ?? type,
|
||||
);
|
||||
|
||||
const repoUrl = `https://github.com/${owner}/${repo}`;
|
||||
const commits: Logs = {};
|
||||
const commits: LogsI = {};
|
||||
|
||||
paginator: for await (const { data } of octokit.paginate.iterator(
|
||||
octokit.rest.repos.listCommits,
|
||||
@@ -20,6 +17,7 @@ export async function generate(
|
||||
per_page: 100,
|
||||
owner,
|
||||
repo,
|
||||
sha,
|
||||
},
|
||||
)) {
|
||||
for (const { sha, ...commit } of data) {
|
||||
@@ -120,13 +118,22 @@ const TYPES = {
|
||||
test: "Tests",
|
||||
};
|
||||
|
||||
interface Logs {
|
||||
interface LogsI {
|
||||
[type: string]: {
|
||||
[category: string]: Log[];
|
||||
[category: string]: LogI[];
|
||||
};
|
||||
}
|
||||
|
||||
interface Log {
|
||||
interface LogI {
|
||||
title: string;
|
||||
commits: string[];
|
||||
}
|
||||
|
||||
export interface InputI {
|
||||
octokit: InstanceType<typeof GitHub>;
|
||||
exclude: string[];
|
||||
owner: string;
|
||||
repo: string;
|
||||
sha: string;
|
||||
tagRef?: string;
|
||||
}
|
||||
+8
-1
@@ -25,7 +25,14 @@ async function run() {
|
||||
} else tagRef = tags[0].commit.sha;
|
||||
}
|
||||
|
||||
const changelog = await generate(octokit, exclude, owner, repo, tagRef);
|
||||
const changelog = await generate({
|
||||
octokit,
|
||||
exclude,
|
||||
owner,
|
||||
repo,
|
||||
sha,
|
||||
tagRef,
|
||||
});
|
||||
|
||||
info(changelog);
|
||||
|
||||
|
||||
Reference in new issue
Block a user