feat: Add exclude & allow-unknown options

This commit is contained in:
Ardalan Amini committed 2020-09-28 16:16:03 +03:30
1 parent 22d355a83e
commit ddb4b06bb9
6 files changed
+48 -5

No files matched your search

+19 -1
View File
@@ -20,4 +20,22 @@ jobs:
- uses: actions/checkout@v2
- uses: ./
with:
token: ${{secrets.GITHUB_TOKEN}}
token: ${{ secrets.GITHUB_TOKEN }}
test-with-exclude: # make sure the action works on a clean machine without building
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
exclude: 'chore,ci,build'
test-with-allow-unknown: # make sure the action works on a clean machine without building
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
allow-unknown: 'true'
+11 -1
View File
@@ -8,6 +8,14 @@ Automatic Changelog generator
**Required** Github token.
### `exclude`
Exclude selected commit types (comma separated).
### `allow-unknown`
Allow unknown commit types.
## Outputs
### `changelog`
@@ -19,5 +27,7 @@ The generated changelog.
```yaml
uses: ardalanamini/[email protected]
with:
token: ${{secrets.GITHUB_TOKEN}}
token: ${{ secrets.GITHUB_TOKEN }}
exclude: 'perf,other,breaking'
allow-unknown: 'true'
```
+8
View File
@@ -8,6 +8,14 @@ inputs:
token:
description: 'Github token'
required: true
exclude:
description: 'Exclude selected commit types (comma separated)'
required: false
default: ''
allow-unknown:
description: 'Allow unknown commit types'
required: false
default: 'false'
outputs:
changelog:
description: 'The generated changelogs'
+1 -1
View File
@@ -1,2 +1,2 @@
require('./sourcemap-register.js');module.exports=(()=>{var __webpack_modules__={9283:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function fulfilled(e){try{step(n.next(e))}catch(e){o(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){o(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())})};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const s=r(2186);const i=r(5438);const a=o(r(510));function run(){return n(this,void 0,void 0,function*(){try{const e=s.getInput("token",{required:true});const t=i.getOctokit(e);const{repo:{owner:r,repo:n},sha:o}=i.context;const{data:c}=yield t.repos.listTags({owner:r,repo:n,per_page:2});let u;if(c.length>0){if(o===c[0].commit.sha){if(c.length>1)u=c[1].name}else u=c[0].name}const l=yield a.default.generate({repoUrl:`https://github.com/${r}/${n}`,tag:u});s.info(l);s.setOutput("changelog",l)}catch(e){s.setFailed(e.message)}})}run()},7351:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(Object.hasOwnProperty.call(e,r))t[r]=e[r];t["default"]=e;return t};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(2087));const s=r(5278);function issueCommand(e,t,r){const n=new Command(e,t,r);process.stdout.write(n.toString()+o.EOL)}t.issueCommand=issueCommand;function issue(e,t=""){issueCommand(e,{},t)}t.issue=issue;const i="::";class Command{constructor(e,t,r){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=r}toString(){let e=i+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let t=true;for(const r in this.properties){if(this.properties.hasOwnProperty(r)){const n=this.properties[r];if(n){if(t){t=false}else{e+=","}e+=`${r}=${escapeProperty(n)}`}}}}e+=`${i}${escapeData(this.message)}`;return e}}function escapeData(e){return s.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(e){return s.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},2186:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function fulfilled(e){try{step(n.next(e))}catch(e){o(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){o(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())})};var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(Object.hasOwnProperty.call(e,r))t[r]=e[r];t["default"]=e;return t};Object.defineProperty(t,"__esModule",{value:true});const s=r(7351);const i=r(717);const a=r(5278);const c=o(r(2087));const u=o(r(5622));var l;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(l=t.ExitCode||(t.ExitCode={}));function exportVariable(e,t){const r=a.toCommandValue(t);process.env[e]=r;const n=process.env["GITHUB_ENV"]||"";if(n){const t="_GitHubActionsFileCommandDelimeter_";const n=`${e}<<${t}${c.EOL}${r}${c.EOL}${t}`;i.issueCommand("ENV",n)}else{s.issueCommand("set-env",{name:e},r)}}t.exportVariable=exportVariable;function setSecret(e){s.issueCommand("add-mask",{},e)}t.setSecret=setSecret;function addPath(e){const t=process.env["GITHUB_PATH"]||"";if(t){i.issueCommand("PATH",e)}else{s.issueCommand("add-path",{},e)}process.env["PATH"]=`${e}${u.delimiter}${process.env["PATH"]}`}t.addPath=addPath;function getInput(e,t){const r=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(t&&t.required&&!r){throw new Error(`Input required and not supplied: ${e}`)}return r.trim()}t.getInput=getInput;function setOutput(e,t){s.issueCommand("set-output",{name:e},t)}t.setOutput=setOutput;function setCommandEcho(e){s.issue("echo",e?"on":"off")}t.setCommandEcho=setCommandEcho;function setFailed(e){process.exitCode=l.Failure;error(e)}t.setFailed=setFailed;function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}t.isDebug=isDebug;function debug(e){s.issueCommand("debug",{},e)}t.debug=debug;function error(e){s.issue("error",e instanceof Error?e.toString():e)}t.error=error;function warning(e){s.issue("warning",e instanceof Error?e.toString():e)}t.warning=warning;function info(e){process.stdout.write(e+c.EOL)}t.info=info;function startGroup(e){s.issue("group",e)}t.startGroup=startGroup;function endGroup(){s.issue("endgroup")}t.endGroup=endGroup;function group(e,t){return n(this,void 0,void 0,function*(){startGroup(e);let r;try{r=yield t()}finally{endGroup()}return r})}t.group=group;function saveState(e,t){s.issueCommand("save-state",{name:e},t)}t.saveState=saveState;function getState(e){returLine truncated
require('./sourcemap-register.js');module.exports=(()=>{var __webpack_modules__={9283:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function fulfilled(e){try{step(n.next(e))}catch(e){o(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){o(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())})};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const s=r(2186);const i=r(5438);const a=o(r(510));function run(){return n(this,void 0,void 0,function*(){try{const e=s.getInput("token",{required:true});const t=s.getInput("exclude",{required:false}).split(",");const r=s.getInput("allow-unknown",{required:false})==="true";const n=i.getOctokit(e);const{repo:{owner:o,repo:c},sha:u}=i.context;const{data:l}=yield n.repos.listTags({owner:o,repo:c,per_page:2});let p;if(l.length>0){if(u===l[0].commit.sha){if(l.length>1)p=l[1].name}else p=l[0].name}let f=yield a.default.generate({repoUrl:`https://github.com/${o}/${c}`,tag:p,exclude:t,allowUnknown:r});f=f.replace(/^#+ +(\d)/,"#### v$1");s.info(f);s.setOutput("changelog",f)}catch(e){s.setFailed(e.message)}})}run()},7351:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(Object.hasOwnProperty.call(e,r))t[r]=e[r];t["default"]=e;return t};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(2087));const s=r(5278);function issueCommand(e,t,r){const n=new Command(e,t,r);process.stdout.write(n.toString()+o.EOL)}t.issueCommand=issueCommand;function issue(e,t=""){issueCommand(e,{},t)}t.issue=issue;const i="::";class Command{constructor(e,t,r){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=r}toString(){let e=i+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let t=true;for(const r in this.properties){if(this.properties.hasOwnProperty(r)){const n=this.properties[r];if(n){if(t){t=false}else{e+=","}e+=`${r}=${escapeProperty(n)}`}}}}e+=`${i}${escapeData(this.message)}`;return e}}function escapeData(e){return s.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(e){return s.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},2186:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function fulfilled(e){try{step(n.next(e))}catch(e){o(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){o(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())})};var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(Object.hasOwnProperty.call(e,r))t[r]=e[r];t["default"]=e;return t};Object.defineProperty(t,"__esModule",{value:true});const s=r(7351);const i=r(717);const a=r(5278);const c=o(r(2087));const u=o(r(5622));var l;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(l=t.ExitCode||(t.ExitCode={}));function exportVariable(e,t){const r=a.toCommandValue(t);process.env[e]=r;const n=process.env["GITHUB_ENV"]||"";if(n){const t="_GitHubActionsFileCommandDelimeter_";const n=`${e}<<${t}${c.EOL}${r}${c.EOL}${t}`;i.issueCommand("ENV",n)}else{s.issueCommand("set-env",{name:e},r)}}t.exportVariable=exportVariable;function setSecret(e){s.issueCommand("add-mask",{},e)}t.setSecret=setSecret;function addPath(e){const t=process.env["GITHUB_PATH"]||"";if(t){i.issueCommand("PATH",e)}else{s.issueCommand("add-path",{},e)}process.env["PATH"]=`${e}${u.delimiter}${process.env["PATH"]}`}t.addPath=addPath;function getInput(e,t){const r=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(t&&t.required&&!r){throw new Error(`Input required and not supplied: ${e}`)}return r.trim()}t.getInput=getInput;function setOutput(e,t){s.issueCommand("set-output",{name:e},t)}t.setOutput=setOutput;function setCommandEcho(e){s.issue("echo",e?"on":"off")}t.setCommandEcho=setCommandEcho;function setFailed(e){process.exitCode=l.Failure;error(e)}t.setFailed=setFailed;function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}t.isDebug=isDebug;function debug(e){s.issueCommand("debug",{},e)}t.debug=debug;function error(e){s.issue("error",e instanceof Error?e.toString():e)}t.error=error;function warning(e){s.issue("warning",e instanceof Error?e.toString():e)}t.warning=warning;function info(e){process.stdout.write(e+c.EOL)}t.info=info;function startGroup(e){s.issue("group",e)}t.startGroup=startGroup;function endGroup(){s.issue("endgroup")}t.endGroup=endGroup;function group(e,t){return n(this,void 0,void 0,function*(){startGroup(e)Line truncated
//# sourceMappingURL=index.js.map
+1 -1
View File
@@ -1 +1 @@
{"version":3,"sources":["../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/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/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/bluebird/js/release/any.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/async.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/bind.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/bluebird.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/call_get.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/cancel.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/catch_filter.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/context.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/debuggability.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/direct_resolve.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/each.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/errors.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/es5.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/filter.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/finally.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/generators.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/join.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/map.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/method.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/nodeback.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/nodeify.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/promise.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/promise_array.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/promisify.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/props.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/queue.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/race.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/reduce.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/schedule.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/settle.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/some.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/synchronous_inspection.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/thenables.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/timers.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/using.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/util.js","../webpack:/auto-changelog/node_modules/deprecation/dist-node/index.js","../webpack:/auto-changelog/node_modules/generate-changelog/lib/file.js","../webpack:/auto-changelog/node_modules/generate-changelog/lib/git.js","../webpack:/auto-changelog/node_modules/generate-changelog/lib/index.js","../webpack:/auto-changelog/node_modules/generate-changelog/lib/package.js","../webpack:/auto-changelog/node_modules/generate-changelog/lib/writer.js","../webpack:/auto-changelog/node_modules/github-url-from-git/index.js","../webpack:/auto-changelog/node_modules/is-plain-object/dist/is-plain-object.js","../webpack:/auto-changeLine truncated
{"version":3,"sources":["../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/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/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/bluebird/js/release/any.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/async.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/bind.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/bluebird.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/call_get.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/cancel.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/catch_filter.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/context.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/debuggability.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/direct_resolve.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/each.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/errors.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/es5.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/filter.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/finally.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/generators.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/join.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/map.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/method.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/nodeback.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/nodeify.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/promise.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/promise_array.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/promisify.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/props.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/queue.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/race.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/reduce.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/schedule.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/settle.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/some.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/synchronous_inspection.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/thenables.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/timers.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/using.js","../webpack:/auto-changelog/node_modules/bluebird/js/release/util.js","../webpack:/auto-changelog/node_modules/deprecation/dist-node/index.js","../webpack:/auto-changelog/node_modules/generate-changelog/lib/file.js","../webpack:/auto-changelog/node_modules/generate-changelog/lib/git.js","../webpack:/auto-changelog/node_modules/generate-changelog/lib/index.js","../webpack:/auto-changelog/node_modules/generate-changelog/lib/package.js","../webpack:/auto-changelog/node_modules/generate-changelog/lib/writer.js","../webpack:/auto-changelog/node_modules/github-url-from-git/index.js","../webpack:/auto-changelog/node_modules/is-plain-object/dist/is-plain-object.js","../webpack:/auto-changeLine truncated
+8 -1
View File
@@ -5,6 +5,9 @@ import Changelog from "generate-changelog";
async function run() {
try {
const token = getInput("token", { required: true });
const exclude = getInput("exclude", { required: false }).split(",");
const allowUnknown =
getInput("allow-unknown", { required: false }) === "true";
const octokit = getOctokit(token);
const {
repo: { owner, repo },
@@ -25,11 +28,15 @@ async function run() {
} else tag = tags[0].name;
}
const changelog = await Changelog.generate({
let changelog = await Changelog.generate({
repoUrl: `https://github.com/${owner}/${repo}`,
tag,
exclude,
allowUnknown,
});
changelog = changelog.replace(/^#+ +(\d)/, "#### v$1");
info(changelog);
setOutput("changelog", changelog);