mirror of
https://github.com/joelwmale/webhook-action.git
synced 2024-11-25 08:56:57 +01:00
feat: finish updates & adding github event support
This commit is contained in:
parent
a976623266
commit
14b045decf
11 changed files with 234 additions and 26 deletions
|
@ -25,6 +25,9 @@
|
|||
"plugin:@typescript-eslint/recommended"
|
||||
],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-explicit-any": "off"
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"github/no-then": "off",
|
||||
"import/no-namespace": "off",
|
||||
"i18n-text/no-en": "off"
|
||||
}
|
||||
}
|
44
README.md
44
README.md
|
@ -20,7 +20,7 @@ Example:
|
|||
url: ${{ secrets.WEBHOOK_URL }}
|
||||
headers: '{"repository": "joelwmale/webhook-action"}'
|
||||
body: '{"event": "deployment", "repository": "joelwmale/webhook-action"}'
|
||||
github_event: ${{ toJson(github.event) }}
|
||||
github_event_payload: true
|
||||
```
|
||||
|
||||
It is **highly** recommended to use the action is an explicit commit SHA-1:
|
||||
|
@ -35,12 +35,28 @@ The action has support for the following input variables (arguments):
|
|||
* **`headers`** (**optional**): Any headers you want to be sent with the webhook
|
||||
* **`body`** (**optional**): The body of data send with the webhook
|
||||
* **`insecure`** (**optional**): Enables calling to known self-signed or invalid SSL certificates
|
||||
* **`github_event`** (**optional**): Enables forwarding the Github event to your webhook
|
||||
* **`github_event_payload`** (**optional**): Enables forwarding the Github event payload to your webhook.
|
||||
|
||||
You can find more information on how to use these input variables below.
|
||||
|
||||
## Arguments
|
||||
|
||||
#### URL
|
||||
|
||||
**Required:** true
|
||||
|
||||
The URL to send the webhook to
|
||||
|
||||
```yml
|
||||
url: ${{ secrets.WEBHOOK_URL }}
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```yml
|
||||
url: https://webhook.site/8b1b1b1b-8b1b-8b1b-8b1b-8b1b1b1b1b1b
|
||||
```
|
||||
|
||||
#### Headers
|
||||
|
||||
**Required:** false
|
||||
|
@ -62,6 +78,30 @@ Allows you to send a custom JSON object to the webhook
|
|||
body: '{"event": "deployment", "repository": "joelwmale/webhook-action"}'
|
||||
```
|
||||
|
||||
#### Insecure
|
||||
|
||||
**Required:** false
|
||||
**Default:** false
|
||||
|
||||
Allows you to send a webhook to a known self-signed or invalid SSL certificate
|
||||
|
||||
```yml
|
||||
insecure: true
|
||||
```
|
||||
|
||||
#### Github Event Payload
|
||||
|
||||
**Required:** false
|
||||
**Default:** false
|
||||
|
||||
Allows you to send the Github event payload to your webhook
|
||||
|
||||
The payload will be sent as a JSON object under the key `githubEventPayload` on the root of the payload sent to your webhook
|
||||
|
||||
```yml
|
||||
github_event_payload: true
|
||||
```
|
||||
|
||||
## Issues
|
||||
|
||||
If you find any issues or have an improvement feel free to [submit an issue](https://github.com/joelwmale/webhook-action/issues/new)
|
||||
|
|
|
@ -17,8 +17,8 @@ inputs:
|
|||
insecure:
|
||||
description: 'Enables calling to known self-signed or invalid SSL certificates'
|
||||
required: false
|
||||
github_event:
|
||||
description: 'Include the event that triggered the action in the payload body'
|
||||
github_event_payload:
|
||||
description: 'Include the github event payload that triggered the action in the payload'
|
||||
required: false
|
||||
outputs:
|
||||
status:
|
||||
|
|
10
dist/index.js
vendored
10
dist/index.js
vendored
|
@ -72,14 +72,14 @@ function run() {
|
|||
? process.env.data
|
||||
: null;
|
||||
const insecure = core.getInput('insecure')
|
||||
? core.getInput('insecure') == 'true'
|
||||
? core.getInput('insecure') === 'true'
|
||||
: process.env.insecure
|
||||
? process.env.insecure == 'true'
|
||||
? process.env.insecure === 'true'
|
||||
: false;
|
||||
const githubEvent = core.getInput('github_event') == 'true';
|
||||
if (githubEvent) {
|
||||
const githubEventPayload = core.getInput('github_event_payload') === 'true';
|
||||
if (githubEventPayload) {
|
||||
const decodedBody = JSON.parse(body || '{}');
|
||||
decodedBody.github_event = github_1.context;
|
||||
decodedBody.githubEventPayload = github_1.context.payload || {};
|
||||
body = JSON.stringify(decodedBody);
|
||||
}
|
||||
if (!url) {
|
||||
|
|
23
dist/licenses.txt
vendored
Normal file
23
dist/licenses.txt
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
node-fetch
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 - 2020 Node Fetch Team
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
10
dist/main.js
vendored
10
dist/main.js
vendored
|
@ -30,14 +30,14 @@ function run() {
|
|||
? process.env.data
|
||||
: null;
|
||||
const insecure = core.getInput('insecure')
|
||||
? core.getInput('insecure') == 'true'
|
||||
? core.getInput('insecure') === 'true'
|
||||
: process.env.insecure
|
||||
? process.env.insecure == 'true'
|
||||
? process.env.insecure === 'true'
|
||||
: false;
|
||||
const githubEvent = core.getInput('github_event') == 'true';
|
||||
if (githubEvent) {
|
||||
const githubEventPayload = core.getInput('github_event_payload') === 'true';
|
||||
if (githubEventPayload) {
|
||||
const decodedBody = JSON.parse(body || '{}');
|
||||
decodedBody.github_event = github_1.context;
|
||||
decodedBody.githubEventPayload = github_1.context.payload || {};
|
||||
body = JSON.stringify(decodedBody);
|
||||
}
|
||||
if (!url) {
|
||||
|
|
2
dist/main.js.map
vendored
2
dist/main.js.map
vendored
|
@ -1 +1 @@
|
|||
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAqC;AACrC,iCAA2B;AAC3B,4CAAuC;AAEvC,SAAe,GAAG;;QAChB,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;YAC9B,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;YACtB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW;gBACvB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW;gBACzB,CAAC,CAAC,EAAE,CAAA;QAER,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;YACtC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;YAC1B,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO;gBACnB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO;gBACrB,CAAC,CAAC,IAAI,CAAA;QAEV,IAAI,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;YAC9B,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;YACvB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI;gBAChB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI;gBAClB,CAAC,CAAC,IAAI,CAAA;QAEV,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;YACxC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,MAAM;YACrC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ;gBACpB,CAAC,CAAC,OAAO,CAAC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ugin-github": "^4.10.2",
|
||||
"eslint-plugin-jest": "^27.9.0",
|
||||
"https": "^1.0.0",
|
||||
"jest": "^29.7.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
|
@ -5030,6 +5031,113 @@
|
|||
"semver": "bin/semver.js"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-jest": {
|
||||
"version": "27.9.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.9.0.tgz",
|
||||
"integrity": "sha512-QIT7FH7fNmd9n4se7FFKHbsLKGQiw885Ds6Y/sxKgCZ6natwCsXdgPOADnYVxN2QrRweF0FZWbJ6S7Rsn7llug==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/utils": "^5.10.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^5.0.0 || ^6.0.0 || ^7.0.0",
|
||||
"eslint": "^7.0.0 || ^8.0.0",
|
||||
"jest": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@typescript-eslint/eslint-plugin": {
|
||||
"optional": true
|
||||
},
|
||||
"jest": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/scope-manager": {
|
||||
"version": "5.62.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz",
|
||||
"integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "5.62.0",
|
||||
"@typescript-eslint/visitor-keys": "5.62.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/utils": {
|
||||
"version": "5.62.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz",
|
||||
"integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.2.0",
|
||||
"@types/json-schema": "^7.0.9",
|
||||
"@types/semver": "^7.3.12",
|
||||
"@typescript-eslint/scope-manager": "5.62.0",
|
||||
"@typescript-eslint/types": "5.62.0",
|
||||
"@typescript-eslint/typescript-estree": "5.62.0",
|
||||
"eslint-scope": "^5.1.1",
|
||||
"semver": "^7.3.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "5.62.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz",
|
||||
"integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "5.62.0",
|
||||
"eslint-visitor-keys": "^3.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-jest/node_modules/eslint-scope": {
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
|
||||
"integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"esrecurse": "^4.3.0",
|
||||
"estraverse": "^4.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-jest/node_modules/estraverse": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
|
||||
"integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-jsx-a11y": {
|
||||
"version": "6.8.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.8.0.tgz",
|
||||
|
|
|
@ -4,13 +4,12 @@
|
|||
"description": "Github Webhook Action",
|
||||
"main": "dist/main.js",
|
||||
"scripts": {
|
||||
"build": "tsc && ncc build",
|
||||
"build": "tsc && ncc build --license licenses.txt",
|
||||
"format": "prettier --write '**/*.ts'",
|
||||
"format-check": "prettier --check '**/*.ts'",
|
||||
"lint": "eslint src/**/*.ts",
|
||||
"package": "ncc build --source-map --license licenses.txt",
|
||||
"test": "jest",
|
||||
"all": "npm run build && npm run format && npm test && npm run lint && npm run package"
|
||||
"all": "npm run format && npm run lint && npm run test&& npm run build"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -39,6 +38,7 @@
|
|||
"babel-jest": "^29.3.1",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-plugin-github": "^4.10.2",
|
||||
"eslint-plugin-jest": "^27.9.0",
|
||||
"https": "^1.0.0",
|
||||
"jest": "^29.7.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
|
|
10
src/main.ts
10
src/main.ts
|
@ -22,20 +22,20 @@ async function run() {
|
|||
: null
|
||||
|
||||
const insecure = core.getInput('insecure')
|
||||
? core.getInput('insecure') == 'true'
|
||||
? core.getInput('insecure') === 'true'
|
||||
: process.env.insecure
|
||||
? process.env.insecure == 'true'
|
||||
? process.env.insecure === 'true'
|
||||
: false
|
||||
|
||||
const githubEvent = core.getInput('github_event') == 'true'
|
||||
const githubEventPayload = core.getInput('github_event_payload') === 'true'
|
||||
|
||||
// if github_event is set to true, append it to the body
|
||||
if (githubEvent) {
|
||||
if (githubEventPayload) {
|
||||
// decode the body
|
||||
const decodedBody = JSON.parse(body || '{}')
|
||||
|
||||
// set the github event
|
||||
decodedBody.github_event = context
|
||||
decodedBody.githubEventPayload = context.payload || {}
|
||||
|
||||
// re-set the body
|
||||
body = JSON.stringify(decodedBody)
|
||||
|
|
38
yarn.lock
38
yarn.lock
|
@ -1484,7 +1484,7 @@
|
|||
dependencies:
|
||||
"@types/istanbul-lib-report" "*"
|
||||
|
||||
"@types/json-schema@^7.0.12":
|
||||
"@types/json-schema@^7.0.12", "@types/json-schema@^7.0.9":
|
||||
version "7.0.15"
|
||||
resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz"
|
||||
integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==
|
||||
|
@ -1501,7 +1501,7 @@
|
|||
dependencies:
|
||||
undici-types "~5.26.4"
|
||||
|
||||
"@types/semver@^7.5.0":
|
||||
"@types/semver@^7.3.12", "@types/semver@^7.5.0":
|
||||
version "7.5.8"
|
||||
resolved "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz"
|
||||
integrity sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==
|
||||
|
@ -1624,6 +1624,20 @@
|
|||
semver "^7.5.4"
|
||||
ts-api-utils "^1.0.1"
|
||||
|
||||
"@typescript-eslint/utils@^5.10.0":
|
||||
version "5.62.0"
|
||||
resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz"
|
||||
integrity sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==
|
||||
dependencies:
|
||||
"@eslint-community/eslint-utils" "^4.2.0"
|
||||
"@types/json-schema" "^7.0.9"
|
||||
"@types/semver" "^7.3.12"
|
||||
"@typescript-eslint/scope-manager" "5.62.0"
|
||||
"@typescript-eslint/types" "5.62.0"
|
||||
"@typescript-eslint/typescript-estree" "5.62.0"
|
||||
eslint-scope "^5.1.1"
|
||||
semver "^7.3.7"
|
||||
|
||||
"@typescript-eslint/utils@7.4.0":
|
||||
version "7.4.0"
|
||||
resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.4.0.tgz"
|
||||
|
@ -2518,6 +2532,13 @@ eslint-plugin-import@^2.25.2:
|
|||
semver "^6.3.1"
|
||||
tsconfig-paths "^3.15.0"
|
||||
|
||||
eslint-plugin-jest@^27.9.0:
|
||||
version "27.9.0"
|
||||
resolved "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.9.0.tgz"
|
||||
integrity sha512-QIT7FH7fNmd9n4se7FFKHbsLKGQiw885Ds6Y/sxKgCZ6natwCsXdgPOADnYVxN2QrRweF0FZWbJ6S7Rsn7llug==
|
||||
dependencies:
|
||||
"@typescript-eslint/utils" "^5.10.0"
|
||||
|
||||
eslint-plugin-jsx-a11y@^6.7.1:
|
||||
version "6.8.0"
|
||||
resolved "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.8.0.tgz"
|
||||
|
@ -2558,6 +2579,14 @@ eslint-rule-documentation@>=1.0.0:
|
|||
resolved "https://registry.npmjs.org/eslint-rule-documentation/-/eslint-rule-documentation-1.0.23.tgz"
|
||||
integrity sha512-pWReu3fkohwyvztx/oQWWgld2iad25TfUdi6wvhhaDPIQjHU/pyvlKgXFw1kX31SQK2Nq9MH+vRDWB0ZLy8fYw==
|
||||
|
||||
eslint-scope@^5.1.1:
|
||||
version "5.1.1"
|
||||
resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz"
|
||||
integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==
|
||||
dependencies:
|
||||
esrecurse "^4.3.0"
|
||||
estraverse "^4.1.1"
|
||||
|
||||
eslint-scope@^7.2.2:
|
||||
version "7.2.2"
|
||||
resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz"
|
||||
|
@ -2643,6 +2672,11 @@ esrecurse@^4.3.0:
|
|||
dependencies:
|
||||
estraverse "^5.2.0"
|
||||
|
||||
estraverse@^4.1.1:
|
||||
version "4.3.0"
|
||||
resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz"
|
||||
integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==
|
||||
|
||||
estraverse@^5.1.0, estraverse@^5.2.0:
|
||||
version "5.3.0"
|
||||
resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz"
|
||||
|
|
Loading…
Reference in a new issue