feat: Add commit-types & default-commit-type inputs (#15)

* deps: Add `yaml` version `1.10.2`

* deps: Add `joi` version `17.6.0`

* feat: Add `commit-types` & `default-commit-type` inputs

* ci: Update `Test` workflow

* chore: Update `README.md`
This commit is contained in:
Ardalan Amini authored and GitHub committed 2022-03-04 14:17:53 +03:30
1 parent c72a270e90
commit ea01804ccf
12 files changed
+374 -77

No files matched your search

+3
View File
@@ -62,3 +62,6 @@ jobs:
uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-types: |
feat: Feature
default-commit-type: Default Type
+73 -25
View File
@@ -12,42 +12,66 @@ To use this action, your commit messages have to follow the format below:
type(category): description [flag]
```
The `type` must be one of the followings:
* The `type` must be one of `commit-types` input keys. In the changelog output, the value will be used.
* `breaking` (Breaking Changes)
* `feat` (New Features)
* `fix` (Bug Fixes)
* `revert` (Reverts)
* `perf` (Performance Improvements)
* `refactor` (Refactors)
* `deps` (Dependencies)
* `docs` (Documentation Changes)
* `style` (Code Style Changes)
* `build` (Build System)
* `ci` (Continuous Integration)
* `test` (Tests)
* `chore` (Chores)
* `other` (Other Changes)
> The changelogs will be in the same order as `commit-types` input.
> The changelogs will be in the same order as listed above.
> If the `type` doesn't match any of the provided `commit-types` input keys, The `default-commit-type` input will be used instead.
> If the `type` is not found in the list, it'll be considered as `other`.
* The `category` is optional and can be anything of your choice.
The `category` is optional and can be anything of your choice.
* The `flag` is optional (if provided, it must be surrounded in square brackets) and can be one of the followings:
The `flag` is optional (if provided, it must be surrounded in square brackets) and can be one of the followings:
* `ignore` (Omits the commit from the changelog)
* `ignore` (Omits the commit from the changelog)
> If `flag` is not found in the list, it'll be ignored.
> If `flag` is not found in the list, it'll be ignored.
### Inputs
#### `token` **(Required)**
#### `token` **(Optional)**
Github token.
_Default:_ `${{ github.token }}`
_Default:_
```yaml
${{ github.token }}
```
#### `commit-types` **(Optional)**
Commit type.
_Default:_
```yaml
breaking: Breaking Changes
feat: New Features
fix: Bug Fixes
revert: Reverts
perf: Performance Improvements
refactor: Refactors
deps: Dependencies
docs: Documentation Changes
style: Code Style Changes
build: Build System
ci: Continuous Integration
test: Tests
chore: Chores
other: Other Changes
```
#### `default-commit-type` **(Optional)**
Default commit type.
This input will be used when the commit message matches none of the defined `commit-types` input.
_Default:_
```yaml
Other Changes
```
### Outputs
@@ -57,8 +81,32 @@ The generated changelog.
### Example usage
Using default inputs:
```yaml
uses: ardalanamini/auto-changelog@v1
```
Using custom inputs:
```yaml
uses: ardalanamini/auto-changelog@v1
with:
exclude: 'perf,other,breaking'
token: ${{ github.token }}
commit-types: |
breaking: Breaking Changes
feat: New Features
fix: Bug Fixes
revert: Reverts
perf: Performance Improvements
refactor: Refactors
deps: Dependencies
docs: Documentation Changes
style: Code Style Changes
build: Build System
ci: Continuous Integration
test: Tests
chore: Chores
other: Other Changes
default-commit-type: Other Changes
```
+24
View File
@@ -15,6 +15,30 @@ inputs:
required: true
default: ${{ github.token }}
commit-types:
description: 'Commit types'
required: false
default: |
breaking: Breaking Changes
feat: New Features
fix: Bug Fixes
revert: Reverts
perf: Performance Improvements
refactor: Refactors
deps: Dependencies
docs: Documentation Changes
style: Code Style Changes
build: Build System
ci: Continuous Integration
test: Tests
chore: Chores
other: Other Changes
default-commit-type:
description: 'Default commit type to be used when the commit message matches none of the defined types'
required: false
default: 'Other Changes'
outputs:
changelog:
+2 -2
View File
@@ -1,8 +1,8 @@
require('./sourcemap-register.js');(()=>{var __webpack_modules__={7412: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())}))};var t=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 r=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;const i=a(1912);function generate(e){var p,a;var s,o,m;return d(this,void 0,void 0,(function*(){const{octokit:d,owner:l,repo:n,sha:u,tagRef:c}=e;const v=`https://github.com/${l}/${n}`;const h={};try{e:for(var w=t(d.paginate.iterator(d.rest.repos.listCommits,{per_page:100,owner:l,repo:n,sha:u})),g;g=yield w.next(),!g.done;){const{data:e}=g.value;for(let p of e){const{sha:e}=p,a=r(p,["sha"]);if(e===c)break e;const d=a.commit.message.split("\n")[0];let[,t,l,n,u]=i.COMMIT_REGEX.exec(d)||[];if(!n)continue;u=trim(u);if(u==="ignore")continue;t=trim(t);t=(s=i.TYPES[t])!==null&&s!==void 0?s:i.TYPES.other;l=l?trim(l):"";n=trim(n).replace(i.PR_REGEX,((e,p)=>`[${e}](${v}/pull/${p})`));h[t]=(o=h[t])!==null&&o!==void 0?o:{};h[t][l]=(m=h[t][l])!==null&&m!==void 0?m:[];const w=h[t][l].findIndex((e=>e.title===n));if(w===-1)h[t][l].push({title:n,commits:[e]});else h[t][l][w].commits.push(e)}}}catch(e){p={error:e}}finally{try{if(g&&!g.done&&(a=w.return))yield a.call(w)}finally{if(p)throw p.error}}return Object.values(i.TYPES).reduce(((e,p)=>{const a=h[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)}](${v}/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," ")}},1912:(e,p)=>{"use strict";Object.defineProperty(p,"__esModule",{value:true});p.TYPES=p.PR_REGEX=p.COMMIT_REGEX=void 0;p.COMMIT_REGEX=/^([^)]*)(?:\(([^)]*?)\)|):(.*?)(?:\[([^\]]+?)\]|)\s*$/;p.PR_REGEX=/#([1-9]\d*)/g;p.TYPES={breaking:"Breaking Changes",feat:"New Features",fix:"Bug Fixes",revert:"Reverts",perf:"Performance Improvements",refactor:"Refactors",deps:"Dependencies",docs:"Documentation Changes",style:"Code Style Changes",build:"Build System",ci:"Continuous Integration",test:"Tests",chore:"Chores",other:"Other Changes"}},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,r.getOctokit)(e);const{repo:{owner:a,repo:d},sha:s}=r.context;const{data:o}=yield p.rest.repos.listTags({owner:a,repo:d,per_page:2});let m;if(o.length>0){if(s===o[0].commit.sha){if(o.length>1)m=o[1].commit.sha}else m=o[0].commit.sha}const l=yield(0,i.generate)({octokit:p,owner:a,repo:d,sha:s,tagRef:m});(0,t.info)(l);(0,t.setOutput)("changelog",l)}))}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!=Line truncated
require('./sourcemap-register.js');(()=>{var __webpack_modules__={7412:function(e,t,a){"use strict";var r=this&&this.__awaiter||function(e,t,a,r){function adopt(e){return e instanceof a?e:new a((function(t){t(e)}))}return new(a||(a=Promise))((function(a,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){s(e)}}function step(e){e.done?a(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))};var s=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],a;return t?t.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(t){a[t]=e[t]&&function(a){return new Promise((function(r,s){a=e[t](a),settle(r,s,a.done,a.value)}))}}function settle(e,t,a,r){Promise.resolve(r).then((function(t){e({value:t,done:a})}),t)}};var i=this&&this.__rest||function(e,t){var a={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0)a[r]=e[r];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++){if(t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s]))a[r[s]]=e[r[s]]}return a};Object.defineProperty(t,"__esModule",{value:true});t.generate=void 0;const n=a(1912);function generate(e){var t,a;var p,o,d;return r(this,void 0,void 0,(function*(){const{octokit:r,owner:l,repo:m,sha:c,tagRef:u,inputs:h}=e;const{commitTypes:g,defaultCommitType:v}=h;const w=`https://github.com/${l}/${m}`;const y={};try{e:for(var b=s(r.paginate.iterator(r.rest.repos.listCommits,{per_page:100,owner:l,repo:m,sha:c})),_;_=yield b.next(),!_.done;){const{data:e}=_.value;for(let t of e){const{sha:e}=t,a=i(t,["sha"]);if(e===u)break e;const r=a.commit.message.split("\n")[0];let[,s,l,m,c]=n.COMMIT_REGEX.exec(r)||[];if(!m)continue;c=trim(c);if(c==="ignore")continue;s=trim(s);s=(p=g[s])!==null&&p!==void 0?p:v;l=l?trim(l):"";m=trim(m).replace(n.PR_REGEX,((e,t)=>`[${e}](${w}/pull/${t})`));y[s]=(o=y[s])!==null&&o!==void 0?o:{};y[s][l]=(d=y[s][l])!==null&&d!==void 0?d:[];const h=y[s][l].findIndex((e=>e.title===m));if(h===-1)y[s][l].push({title:m,commits:[e]});else y[s][l][h].commits.push(e)}}}catch(e){t={error:e}}finally{try{if(_&&!_.done&&(a=b.return))yield a.call(b)}finally{if(t)throw t.error}}const E=unique([...Object.values(g),v]);return E.reduce(((e,t)=>{const a=y[t];if(a==null)return e;e.push(`### ${t}`,"");const r=Object.keys(a).sort();for(const t of r){const r=a[t];const s=t.length===0;if(!s)e.push(`* **${t}:**`);const i=s?"":" ";for(const{title:t,commits:a}of r){e.push(`${i}* ${t} (${a.map((e=>`[${e.slice(0,8)}](${w}/commit/${e})`)).join(",")})`)}}e.push("");return e}),[]).join("\n")}))}t.generate=generate;function trim(e){if(e==null)return e;return e.trim().replace(/ {2,}/g," ")}function unique(e){return[...new Set(e)]}},1912:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.PR_REGEX=t.COMMIT_REGEX=void 0;t.COMMIT_REGEX=/^([^)]*)(?:\(([^)]*?)\)|):(.*?)(?:\[([^\]]+?)\]|)\s*$/;t.PR_REGEX=/#([1-9]\d*)/g},7331:function(e,t,a){"use strict";var r=this&&this.__awaiter||function(e,t,a,r){function adopt(e){return e instanceof a?e:new a((function(t){t(e)}))}return new(a||(a=Promise))((function(a,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){s(e)}}function step(e){e.done?a(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getInputs=t.getToken=void 0;const i=a(2186);const n=s(a(918));const p=s(a(4603));function getToken(){return(0,i.getInput)("token",{required:true})}t.getToken=getToken;function getInputs(){return r(this,void 0,void 0,(function*(){const e=p.default.parse((0,i.getInput)("commit-types",{required:true}));const t=(0,i.getInput)("default-commit-type",{required:true});return n.default.object().keys({commitTypes:n.default.object().pattern(n.default.string(),n.default.string()).required(),defaultCommitType:n.default.string().required()}).validateAsync({commitTypes:e,defaultCommitType:t})}))}t.getInputs=getInputs},9283:function(e,t,a){"use strict";var r=this&&this.__awaiter||function(e,t,a,r){function adopt(e){return e instanceof a?e:new a((function(t){t(e)}))}return new(a||(a=Promise))((function(a,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){s(e)}}function step(e){e.done?a(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});const s=a(2186);const i=a(5438);const n=a(7412);const p=a(7331);function run(){return r(this,void 0,void 0,(function*Line truncated
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/function isObject(e){return Object.prototype.toString.call(e)==="[object Object]"}function isPlainObject(e){var p,a;if(isObject(e)===false)return false;p=e.constructor;if(p===undefined)return true;a=p.prototype;if(isObject(a)===false)return false;if(a.hasOwnProperty("isPrototypeOf")===false){return false}return true}p.isPlainObject=isPlainObject},467:(e,p,a)=>{"use strict";Object.defineProperty(p,"__esModule",{value:true});function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var d=_interopDefault(a(2781));var t=_interopDefault(a(3685));var r=_interopDefault(a(7310));var i=_interopDefault(a(8665));var s=_interopDefault(a(5687));var o=_interopDefault(a(9796));const m=d.Readable;const l=Symbol("buffer");const n=Symbol("type");class Blob{constructor(){this[n]="";const e=arguments[0];const p=arguments[1];const a=[];let d=0;if(e){const p=e;const t=Number(p.length);for(let e=0;e<t;e++){const t=p[e];let r;if(t instanceof Buffer){r=t}else if(ArrayBuffer.isView(t)){r=Buffer.from(t.buffer,t.byteOffset,t.byteLength)}else if(t instanceof ArrayBuffer){r=Buffer.from(t)}else if(t instanceof Blob){r=t[l]}else{r=Buffer.from(typeof t==="string"?t:String(t))}d+=r.length;a.push(r)}}this[l]=Buffer.concat(a);let t=p&&p.type!==undefined&&String(p.type).toLowerCase();if(t&&!/[^\u0020-\u007E]/.test(t)){this[n]=t}}get size(){return this[l].length}get type(){return this[n]}text(){return Promise.resolve(this[l].toString())}arrayBuffer(){const e=this[l];const p=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return Promise.resolve(p)}stream(){const e=new m;e._read=function(){};e.push(this[l]);e.push(null);return e}toString(){return"[object Blob]"}slice(){const e=this.size;const p=arguments[0];const a=arguments[1];let d,t;if(p===undefined){d=0}else if(p<0){d=Math.max(e+p,0)}else{d=Math.min(p,e)}if(a===undefined){t=e}else if(a<0){t=Math.max(e+a,0)}else{t=Math.min(a,e)}const r=Math.max(t-d,0);const i=this[l];const s=i.slice(d,d+r);const o=new Blob([],{type:arguments[2]});o[l]=s;return o}}Object.defineProperties(Blob.prototype,{size:{enumerable:true},type:{enumerable:true},slice:{enumerable:true}});Object.defineProperty(Blob.prototype,Symbol.toStringTag,{value:"Blob",writable:false,enumerable:false,configurable:true});function FetchError(e,p,a){Error.call(this,e);this.message=e;this.type=p;if(a){this.code=this.errno=a.code}Error.captureStackTrace(this,this.constructor)}FetchError.prototype=Object.create(Error.prototype);FetchError.prototype.constructor=FetchError;FetchError.prototype.name="FetchError";let u;try{u=a(2877).convert}catch(e){}const c=Symbol("Body internals");const v=d.PassThrough;function Body(e){var p=this;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},t=a.size;let r=t===undefined?0:t;var i=a.timeout;let s=i===undefined?0:i;if(e==null){e=null}else if(isURLSearchParams(e)){e=Buffer.from(e.toString())}else if(isBlob(e));else if(Buffer.isBuffer(e));else if(Object.prototype.toString.call(e)==="[object ArrayBuffer]"){e=Buffer.from(e)}else if(ArrayBuffer.isView(e)){e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)}else if(e instanceof d);else{e=Buffer.from(String(e))}this[c]={body:e,disturbed:false,error:null};this.size=r;this.timeout=s;if(e instanceof d){e.on("error",(function(e){const a=e.name==="AbortError"?e:new FetchError(`Invalid response body while trying to fetch ${p.url}: ${e.message}`,"system",e);p[c].error=a}))}}Body.prototype={get body(){return this[c].body},get bodyUsed(){return this[c].disturbed},arrayBuffer(){return consumeBody.call(this).then((function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}))},blob(){let e=this.headers&&this.headers.get("content-type")||"";return consumeBody.call(this).then((function(p){return Object.assign(new Blob([],{type:e.toLowerCase()}),{[l]:p})}))},json(){var e=this;return consumeBody.call(this).then((function(p){try{return JSON.parse(p.toString())}catch(p){return Body.Promise.reject(new FetchError(`invalid json response body at ${e.url} reason: ${p.message}`,"invalid-json"))}}))},text(){return consumeBody.call(this).then((function(e){return e.toString()}))},buffer(){return consumeBody.call(this)},textConverted(){var e=this;return consumeBody.call(this).then((function(p){return convertBody(p,e.headers)}))}};Object.defineProperties(Body.prototype,{body:{enumerable:true},bodyUsed:{enumerable:true},arrayBuffer:{enumerable:true},blob:{enumerable:true},json:{enumerable:true},text:{enumerable:true}});Body.mixIn=function(e){for(const p of Object.getOwnPropertyNames(Body.prototype)){if(!(p in e)){const a=Object.getOwnPropertyDescriptor(Body.prototype,p);Object.defineProperty(e,p,a)}}};function consumeBody(){var e=this;if(this[c].disturbed){return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`))}this[c].disturbed=true;if(this[c].error){return Body.Promise.reject(this[c].error)}let p=this.body;if(p===null){return Body.Promise.resolve(Buffer.alloc(0))}if(isBlob(p)){p=p.stream()}if(Buffer.iLine truncated
*/function isObject(e){return Object.prototype.toString.call(e)==="[object Object]"}function isPlainObject(e){var t,a;if(isObject(e)===false)return false;t=e.constructor;if(t===undefined)return true;a=t.prototype;if(isObject(a)===false)return false;if(a.hasOwnProperty("isPrototypeOf")===false){return false}return true}t.isPlainObject=isPlainObject},6014:(e,t,a)=>{"use strict";const r=a(5578);const s=a(2448);const i={annotations:Symbol("annotations")};t.error=function(e){if(!this._original||typeof this._original!=="object"){return this.details[0].message}const t=e?"":"";const a=e?"":"";const n=e?"":"";const p=r(this._original);for(let e=this.details.length-1;e>=0;--e){const t=e+1;const a=this.details[e];const r=a.path;let n=p;for(let e=0;;++e){const p=r[e];if(s.isSchema(n)){n=n.clone()}if(e+1<r.length&&typeof n[p]!=="string"){n=n[p]}else{const e=n[i.annotations]||{errors:{},missing:{}};n[i.annotations]=e;const r=p||a.context.key;if(n[p]!==undefined){e.errors[r]=e.errors[r]||[];e.errors[r].push(t)}else{e.missing[r]=t}break}}}const o={key:/_\$key\$_([, \d]+)_\$end\$_"/g,missing:/"_\$miss\$_([^|]+)\|(\d+)_\$end\$_": "__missing__"/g,arrayIndex:/\s*"_\$idx\$_([, \d]+)_\$end\$_",?\n(.*)/g,specials:/"\[(NaN|Symbol.*|-?Infinity|function.*|\(.*)]"/g};let d=i.safeStringify(p,2).replace(o.key,((e,a)=>`" ${t}[${a}]${n}`)).replace(o.missing,((e,r,s)=>`${a}"${r}"${n}${t} [${s}]: -- missing --${n}`)).replace(o.arrayIndex,((e,a,r)=>`\n${r} ${t}[${a}]${n}`)).replace(o.specials,((e,t)=>t));d=`${d}\n${t}`;for(let e=0;e<this.details.length;++e){const t=e+1;d=`${d}\n[${t}] ${this.details[e].message}`}d=d+n;return d};i.safeStringify=function(e,t){return JSON.stringify(e,i.serializer(),t)};i.serializer=function(){const e=[];const t=[];const cycleReplacer=(a,r)=>{if(t[0]===r){return"[Circular ~]"}return"[Circular ~."+e.slice(0,t.indexOf(r)).join(".")+"]"};return function(a,r){if(t.length>0){const s=t.indexOf(this);if(~s){t.length=s+1;e.length=s+1;e[s]=a}else{t.push(this);e.push(a)}if(~t.indexOf(r)){r=cycleReplacer.call(this,a,r)}}else{t.push(r)}if(r){const e=r[i.annotations];if(e){if(Array.isArray(r)){const t=[];for(let a=0;a<r.length;++a){if(e.errors[a]){t.push(`_$idx$_${e.errors[a].sort().join(", ")}_$end$_`)}t.push(r[a])}r=t}else{for(const t in e.errors){r[`${t}_$key$_${e.errors[t].sort().join(", ")}_$end$_`]=r[t];r[t]=undefined}for(const t in e.missing){r[`_$miss$_${t}|${e.missing[t]}_$end$_`]="__missing__"}}return r}}if(r===Infinity||r===-Infinity||Number.isNaN(r)||typeof r==="function"||typeof r==="symbol"){return"["+r.toString()+"]"}return r}}},5184:(e,t,a)=>{"use strict";const r=a(2718);const s=a(5578);const i=a(5801);const n=a(445);const p=a(3355);const o=a(2448);const d=a(3038);const l=a(9490);const m=a(6680);const c=a(7997);const u=a(6103);const h=a(1290);const g=a(3838);const v=a(3171);const w=a(1804);const y=a(1944);const b={};b.Base=class{constructor(e){this.type=e;this.$_root=null;this._definition={};this._reset()}_reset(){this._ids=new h.Ids;this._preferences=null;this._refs=new g.Manager;this._cache=null;this._valids=null;this._invalids=null;this._flags={};this._rules=[];this._singleRules=new Map;this.$_terms={};this.$_temp={ruleset:null,whens:{}}}describe(){r(typeof c.describe==="function","Manifest functionality disabled");return c.describe(this)}allow(...e){o.verifyFlat(e,"allow");return this._values(e,"_valids")}alter(e){r(e&&typeof e==="object"&&!Array.isArray(e),"Invalid targets argument");r(!this._inRuleset(),"Cannot set alterations inside a ruleset");const t=this.clone();t.$_terms.alterations=t.$_terms.alterations||[];for(const a in e){const s=e[a];r(typeof s==="function","Alteration adjuster for",a,"must be a function");t.$_terms.alterations.push({target:a,adjuster:s})}t.$_temp.ruleset=false;return t}artifact(e){r(e!==undefined,"Artifact cannot be undefined");r(!this._cache,"Cannot set an artifact with a rule cache");return this.$_setFlag("artifact",e)}cast(e){r(e===false||typeof e==="string","Invalid to value");r(e===false||this._definition.cast[e],"Type",this.type,"does not support casting to",e);return this.$_setFlag("cast",e===false?undefined:e)}default(e,t){return this._default("default",e,t)}description(e){r(e&&typeof e==="string","Description must be a non-empty string");return this.$_setFlag("description",e)}empty(e){const t=this.clone();if(e!==undefined){e=t.$_compile(e,{override:false})}return t.$_setFlag("empty",e,{clone:false})}error(e){r(e,"Missing error");r(e instanceof Error||typeof e==="function","Must provide a valid Error object or a function");return this.$_setFlag("error",e)}example(e,t={}){r(e!==undefined,"Missing example");o.assertOptions(t,["override"]);return this._inner("examples",e,{single:true,override:t.override})}external(e,t){if(typeof e==="object"){r(!t,"Cannot combine options with description");t=e.description;e=e.method}r(typeof e==="function","Method must be a function");r(t===undefined||t&&typeof t==="string","Description must be a non-empty string");returLine truncated
//# sourceMappingURL=index.js.map
+1 -1
View File
@@ -1 +1 @@
{"version":3,"sources":["../webpack:/auto-changelog/dist/changelog.js","../webpack:/auto-changelog/dist/constants.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","constants_1","__webpack_require__","input","e_1","_a","_b","_c","_d","octokit","owner","repo","sha","tagRef","repoUrl","commits","paginator","_e","paginate","rest","repos","listCommits","per_page","_f","data","_g","commit","message","split","type","category","title","flag","COMMIT_REGEX","exec","trim","TYPES","other","replace","PR_REGEX","match","pull","existingIndex","findIndex","push","e_1_1","error","return","values","reduce","changelog","tyLine truncated
{"version":3,"sources":["../webpack:/auto-changelog/dist/changelog.js","../webpack:/auto-changelog/dist/constants.js","../webpack:/auto-changelog/dist/context.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/@hapi/hoek/lib/applyToDefaults.js","../webpack:/auto-changelog/node_modules/@hapi/hoek/lib/assert.js","../webpack:/auto-changelog/node_modules/@hapi/hoek/lib/clone.js","../webpack:/auto-changelog/node_modules/@hapi/hoek/lib/deepEqual.js","../webpack:/auto-changelog/node_modules/@hapi/hoek/lib/error.js","../webpack:/auto-changelog/node_modules/@hapi/hoek/lib/escapeHtml.js","../webpack:/auto-changelog/node_modules/@hapi/hoek/lib/escapeRegex.js","../webpack:/auto-changelog/node_modules/@hapi/hoek/lib/ignore.js","../webpack:/auto-changelog/node_modules/@hapi/hoek/lib/merge.js","../webpack:/auto-changelog/node_modules/@hapi/hoek/lib/reach.js","../webpack:/auto-changelog/node_modules/@hapi/hoek/lib/stringify.js","../webpack:/auto-changelog/node_modules/@hapi/hoek/lib/types.js","../webpack:/auto-changelog/node_modules/@hapi/hoek/lib/utils.js","../webpack:/auto-changelog/node_modules/@hapi/topo/lib/index.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/@sideway/address/lib/domain.js","../webpack:/auto-changelog/node_modules/@sideway/address/lib/email.js","../webpack:/auto-changelog/node_modules/@sideway/address/lib/errors.js","../webpack:/auto-changelog/node_modules/@sideway/address/lib/ip.js","../webpack:/auto-changelog/node_modules/@sideway/address/lib/tlds.js","../webpack:/auto-changelog/node_modules/@sideway/address/lib/uri.js","../webpack:/auto-changelog/node_modules/@sideway/formula/lib/index.js","../webpack:/auto-changelog/node_modules/@sideway/pinpoint/lib/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/joi/lib/annotate.js","../webpack:/auto-changelog/node_modules/joi/lib/base.js","../webpack:/auto-changelog/node_modules/joi/lib/cache.js","../webpack:/auto-changelog/node_modules/joi/lib/common.js","../webpack:/auto-changelog/node_modules/joi/lib/compile.js","../webpack:/auto-changelog/node_modules/joi/lib/errors.js","../webpack:/auto-changelog/node_modules/joi/lib/extend.js","../webpack:/auto-changelog/node_modules/joi/lib/index.js","../webpack:/auto-changelog/node_modules/joi/lib/manifest.js","../webpack:/auto-changelog/node_modules/joi/lib/messages.js","../webpack:/auto-changelog/node_modules/joi/lib/modify.js","../webpack:/auto-changelog/node_modules/joi/lib/ref.js","../webpack:/auto-changelog/node_modules/joi/lib/schemas.js","../webpack:/auto-changelog/node_modules/joi/lib/state.js","../webpack:/auto-changelog/node_modules/joi/lib/template.js","../webpack:/auto-changelog/node_modules/joi/lib/trace.js","../webpack:/auto-changelog/node_modules/joi/lib/types/alternatives.js","../webpack:/auto-changelog/node_modules/joi/lib/types/any.js","../webpack:/auto-changelog/node_modules/joi/lib/types/array.js","../webpack:/auto-changelog/node_modules/joi/lib/types/binary.js","../webpack:/auto-changelog/node_modules/joi/lib/types/boolLine truncated
+101
View File
@@ -47,6 +47,36 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@hapi/hoek
BSD-3-Clause
Copyright (c) 2011-2020, Sideway Inc, and project contributors
Copyright (c) 2011-2014, Walmart
Copyright (c) 2011, Yahoo Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* The names of any contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS OFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@hapi/topo
BSD-3-Clause
Copyright (c) 2012-2020, Sideway Inc, and project contributors
Copyright (c) 2012-2014, Walmart.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* The names of any contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS OFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@octokit/auth-token
MIT
The MIT License
@@ -219,6 +249,46 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@sideway/address
BSD-3-Clause
Copyright (c) 2019-2020, Sideway, Inc. and Project contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* The names of any contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@sideway/formula
BSD-3-Clause
Copyright (c) 2019-2020, Sideway. Inc, and project contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* The names of any contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@sideway/pinpoint
BSD-3-Clause
Copyright (c) 2019-2020, Sideway. Inc, and project contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* The names of any contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS OFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@vercel/ncc
MIT
Copyright 2018 ZEIT, Inc.
@@ -478,6 +548,20 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
joi
BSD-3-Clause
Copyright (c) 2012-2020, Sideway. Inc, and project contributors.<br>
Copyright (c) 2012-2014, Walmart.<br>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* The names of any contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
node-fetch
MIT
The MIT License (MIT)
@@ -620,3 +704,20 @@ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
yaml
ISC
Copyright 2018 Eemeli Aro <[email protected]>
Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
+102 -1
View File
@@ -10,7 +10,9 @@
"license": "MIT",
"dependencies": {
"@actions/core": "^1.6.0",
"@actions/github": "^5.0.0"
"@actions/github": "^5.0.0",
"joi": "^17.6.0",
"yaml": "^1.10.2"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.13.0",
@@ -77,6 +79,19 @@
"node": ">= 4"
}
},
"node_modules/@hapi/hoek": {
"version": "9.2.1",
"resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.2.1.tgz",
"integrity": "sha512-gfta+H8aziZsm8pZa0vj04KO6biEiisppNgA1kbJvFrrWu9Vm7eaUEy76DIxsuTaWvti5fkJVhllWc6ZTE+Mdw=="
},
"node_modules/@hapi/topo": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz",
"integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==",
"dependencies": {
"@hapi/hoek": "^9.0.0"
}
},
"node_modules/@humanwhocodes/config-array": {
"version": "0.9.3",
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.3.tgz",
@@ -233,6 +248,24 @@
"@octokit/openapi-types": "^7.3.2"
}
},
"node_modules/@sideway/address": {
"version": "4.1.3",
"resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.3.tgz",
"integrity": "sha512-8ncEUtmnTsMmL7z1YPB47kPUq7LpKWJNFPsRzHiIajGC5uXlWGn+AmkYPcHNl8S4tcEGx+cnORnNYaw2wvL+LQ==",
"dependencies": {
"@hapi/hoek": "^9.0.0"
}
},
"node_modules/@sideway/formula": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.0.tgz",
"integrity": "sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg=="
},
"node_modules/@sideway/pinpoint": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz",
"integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ=="
},
"node_modules/@types/json-schema": {
"version": "7.0.9",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz",
@@ -1145,6 +1178,18 @@
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
"dev": true
},
"node_modules/joi": {
"version": "17.6.0",
"resolved": "https://registry.npmjs.org/joi/-/joi-17.6.0.tgz",
"integrity": "sha512-OX5dG6DTbcr/kbMFj0KGYxuew69HPcAE3K/sZpEV2nP6e/j/C0HV+HNiBPCASxdx5T7DMoa0s8UeHWMnb6n2zw==",
"dependencies": {
"@hapi/hoek": "^9.0.0",
"@hapi/topo": "^5.0.0",
"@sideway/address": "^4.1.3",
"@sideway/formula": "^3.0.0",
"@sideway/pinpoint": "^2.0.0"
}
},
"node_modules/js-yaml": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
@@ -1698,6 +1743,14 @@
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
"dev": true
},
"node_modules/yaml": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
"integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",
"engines": {
"node": ">= 6"
}
}
},
"dependencies": {
@@ -1753,6 +1806,19 @@
}
}
},
"@hapi/hoek": {
"version": "9.2.1",
"resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.2.1.tgz",
"integrity": "sha512-gfta+H8aziZsm8pZa0vj04KO6biEiisppNgA1kbJvFrrWu9Vm7eaUEy76DIxsuTaWvti5fkJVhllWc6ZTE+Mdw=="
},
"@hapi/topo": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz",
"integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==",
"requires": {
"@hapi/hoek": "^9.0.0"
}
},
"@humanwhocodes/config-array": {
"version": "0.9.3",
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.3.tgz",
@@ -1891,6 +1957,24 @@
"@octokit/openapi-types": "^7.3.2"
}
},
"@sideway/address": {
"version": "4.1.3",
"resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.3.tgz",
"integrity": "sha512-8ncEUtmnTsMmL7z1YPB47kPUq7LpKWJNFPsRzHiIajGC5uXlWGn+AmkYPcHNl8S4tcEGx+cnORnNYaw2wvL+LQ==",
"requires": {
"@hapi/hoek": "^9.0.0"
}
},
"@sideway/formula": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.0.tgz",
"integrity": "sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg=="
},
"@sideway/pinpoint": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz",
"integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ=="
},
"@types/json-schema": {
"version": "7.0.9",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz",
@@ -2542,6 +2626,18 @@
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
"dev": true
},
"joi": {
"version": "17.6.0",
"resolved": "https://registry.npmjs.org/joi/-/joi-17.6.0.tgz",
"integrity": "sha512-OX5dG6DTbcr/kbMFj0KGYxuew69HPcAE3K/sZpEV2nP6e/j/C0HV+HNiBPCASxdx5T7DMoa0s8UeHWMnb6n2zw==",
"requires": {
"@hapi/hoek": "^9.0.0",
"@hapi/topo": "^5.0.0",
"@sideway/address": "^4.1.3",
"@sideway/formula": "^3.0.0",
"@sideway/pinpoint": "^2.0.0"
}
},
"js-yaml": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
@@ -2922,6 +3018,11 @@
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
"dev": true
},
"yaml": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
"integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg=="
}
}
}
+3 -1
View File
@@ -34,7 +34,9 @@
},
"dependencies": {
"@actions/core": "^1.6.0",
"@actions/github": "^5.0.0"
"@actions/github": "^5.0.0",
"joi": "^17.6.0",
"yaml": "^1.10.2"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.13.0",
+31 -26
View File
@@ -1,7 +1,8 @@
import { COMMIT_REGEX, InputI, LogsI, PR_REGEX, TYPES } from "./constants";
import { ChangelogInputI, COMMIT_REGEX, LogsI, PR_REGEX } from "./constants";
export async function generate(input: InputI): Promise<string> {
const { octokit, owner, repo, sha, tagRef } = input;
export async function generate(input: ChangelogInputI): Promise<string> {
const { octokit, owner, repo, sha, tagRef, inputs } = input;
const { commitTypes, defaultCommitType } = inputs;
const repoUrl = `https://github.com/${owner}/${repo}`;
const commits: LogsI = {};
@@ -28,7 +29,7 @@ export async function generate(input: InputI): Promise<string> {
if (flag === "ignore") continue;
type = trim(type);
type = TYPES[type] ?? TYPES.other;
type = commitTypes[type] ?? defaultCommitType;
category = category ? trim(category) : "";
@@ -50,38 +51,38 @@ export async function generate(input: InputI): Promise<string> {
}
}
return Object.values(TYPES)
.reduce((changelog, type) => {
const typeGroup = commits[type];
const TYPES = unique([...Object.values(commitTypes), defaultCommitType]);
if (typeGroup == null) return changelog;
return TYPES.reduce((changelog, type) => {
const typeGroup = commits[type];
changelog.push(`### ${type}`, "");
if (typeGroup == null) return changelog;
const categories = Object.keys(typeGroup).sort();
changelog.push(`### ${type}`, "");
for (const category of categories) {
const categoryGroup = typeGroup[category];
const defaultCategory = category.length === 0;
const categories = Object.keys(typeGroup).sort();
if (!defaultCategory) changelog.push(`* **${category}:**`);
for (const category of categories) {
const categoryGroup = typeGroup[category];
const defaultCategory = category.length === 0;
const baseLine = defaultCategory ? "" : " ";
if (!defaultCategory) changelog.push(`* **${category}:**`);
for (const { title, commits } of categoryGroup) {
changelog.push(
`${baseLine}* ${title} (${commits
.map((sha) => `[${sha.slice(0, 8)}](${repoUrl}/commit/${sha})`)
.join(",")})`,
);
}
const baseLine = defaultCategory ? "" : " ";
for (const { title, commits } of categoryGroup) {
changelog.push(
`${baseLine}* ${title} (${commits
.map((sha) => `[${sha.slice(0, 8)}](${repoUrl}/commit/${sha})`)
.join(",")})`,
);
}
}
changelog.push("");
changelog.push("");
return changelog;
}, [] as string[])
.join("\n");
return changelog;
}, [] as string[]).join("\n");
}
function trim(value: string): string {
@@ -89,3 +90,7 @@ function trim(value: string): string {
return value.trim().replace(/ {2,}/g, " ");
}
function unique(value: string[]): string[] {
return [...new Set(value)];
}
+7 -18
View File
@@ -4,23 +4,6 @@ export const COMMIT_REGEX =
/^([^)]*)(?:\(([^)]*?)\)|):(.*?)(?:\[([^\]]+?)\]|)\s*$/;
export const PR_REGEX = /#([1-9]\d*)/g;
export const TYPES: TypesI = {
breaking: "Breaking Changes",
feat: "New Features",
fix: "Bug Fixes",
revert: "Reverts",
perf: "Performance Improvements",
refactor: "Refactors",
deps: "Dependencies",
docs: "Documentation Changes",
style: "Code Style Changes",
build: "Build System",
ci: "Continuous Integration",
test: "Tests",
chore: "Chores",
other: "Other Changes",
};
export interface TypesI {
[type: string]: string;
}
@@ -36,10 +19,16 @@ export interface LogI {
commits: string[];
}
export interface InputI {
export interface ChangelogInputI {
octokit: InstanceType<typeof GitHub>;
owner: string;
repo: string;
sha: string;
tagRef?: string;
inputs: ActionInputsI;
}
export interface ActionInputsI {
commitTypes: TypesI;
defaultCommitType: string;
}
+22
View File
@@ -0,0 +1,22 @@
import { getInput } from "@actions/core";
import Joi from "joi";
import YAML from "yaml";
import { ActionInputsI, TypesI } from "./constants";
export function getToken(): string {
return getInput("token", { required: true });
}
export async function getInputs(): Promise<ActionInputsI> {
const commitTypes = YAML.parse(getInput("commit-types", { required: true }));
const defaultCommitType = getInput("default-commit-type", { required: true });
return Joi.object<ActionInputsI, true>()
.keys({
commitTypes: Joi.object<TypesI>()
.pattern(Joi.string(), Joi.string())
.required(),
defaultCommitType: Joi.string().required(),
})
.validateAsync({ commitTypes, defaultCommitType });
}
+5 -3
View File
@@ -1,11 +1,12 @@
import { getInput, info, setFailed, setOutput } from "@actions/core";
import { info, setFailed, setOutput } from "@actions/core";
import { context, getOctokit } from "@actions/github";
import { generate } from "./changelog";
import { getInputs, getToken } from "./context";
async function run() {
const token = getInput("token", { required: true });
const inputs = await getInputs();
const octokit = getOctokit(token);
const octokit = getOctokit(getToken());
const {
repo: { owner, repo },
@@ -32,6 +33,7 @@ async function run() {
repo,
sha,
tagRef,
inputs,
});
info(changelog);