Merge pull request #358 from mjpieters/request-log-plugin

Add @octokit/plugin-request-log, to produce debug output for requests
This commit is contained in:
Dan Rigby
2023-04-04 13:58:39 -04:00
committed by GitHub
5 changed files with 1379 additions and 1300 deletions

View File

@@ -0,0 +1,20 @@
---
name: "@octokit/plugin-request-token"
version: 1.0.4
type: npm
summary: GitHub API token authentication for browsers and Node.js
homepage: https://github.com/octokit/plugin-request-log.js#readme
license: mit
licenses:
- sources: LICENSE
text: |
MIT License Copyright (c) 2019 Octokit contributors
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 (including the next paragraph) 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.
- sources: README.md
text: "[MIT](LICENSE)"
notices: []

2640
dist/index.js vendored

File diff suppressed because it is too large Load Diff

15
package-lock.json generated
View File

@@ -16,6 +16,7 @@
"@actions/io": "^1.1.1", "@actions/io": "^1.1.1",
"@octokit/core": "^3.5.1", "@octokit/core": "^3.5.1",
"@octokit/plugin-paginate-rest": "^2.17.0", "@octokit/plugin-paginate-rest": "^2.17.0",
"@octokit/plugin-request-log": "^1.0.4",
"@octokit/plugin-rest-endpoint-methods": "^6.3.0", "@octokit/plugin-rest-endpoint-methods": "^6.3.0",
"@octokit/plugin-retry": "^3.0.9", "@octokit/plugin-retry": "^3.0.9",
"node-fetch": "^2.6.7" "node-fetch": "^2.6.7"
@@ -1125,6 +1126,14 @@
"@octokit/core": ">=2" "@octokit/core": ">=2"
} }
}, },
"node_modules/@octokit/plugin-request-log": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz",
"integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==",
"peerDependencies": {
"@octokit/core": ">=3"
}
},
"node_modules/@octokit/plugin-rest-endpoint-methods": { "node_modules/@octokit/plugin-rest-endpoint-methods": {
"version": "6.3.0", "version": "6.3.0",
"resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-6.3.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-6.3.0.tgz",
@@ -7092,6 +7101,12 @@
"@octokit/types": "^6.34.0" "@octokit/types": "^6.34.0"
} }
}, },
"@octokit/plugin-request-log": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz",
"integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==",
"requires": {}
},
"@octokit/plugin-rest-endpoint-methods": { "@octokit/plugin-rest-endpoint-methods": {
"version": "6.3.0", "version": "6.3.0",
"resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-6.3.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-6.3.0.tgz",

View File

@@ -38,6 +38,7 @@
"@actions/io": "^1.1.1", "@actions/io": "^1.1.1",
"@octokit/core": "^3.5.1", "@octokit/core": "^3.5.1",
"@octokit/plugin-paginate-rest": "^2.17.0", "@octokit/plugin-paginate-rest": "^2.17.0",
"@octokit/plugin-request-log": "^1.0.4",
"@octokit/plugin-rest-endpoint-methods": "^6.3.0", "@octokit/plugin-rest-endpoint-methods": "^6.3.0",
"@octokit/plugin-retry": "^3.0.9", "@octokit/plugin-retry": "^3.0.9",
"node-fetch": "^2.6.7" "node-fetch": "^2.6.7"

View File

@@ -4,6 +4,7 @@ import {context, getOctokit} from '@actions/github'
import {defaults as defaultGitHubOptions} from '@actions/github/lib/utils' import {defaults as defaultGitHubOptions} from '@actions/github/lib/utils'
import * as glob from '@actions/glob' import * as glob from '@actions/glob'
import * as io from '@actions/io' import * as io from '@actions/io'
import {requestLog} from '@octokit/plugin-request-log'
import {retry} from '@octokit/plugin-retry' import {retry} from '@octokit/plugin-retry'
import {RequestRequestOptions} from '@octokit/types' import {RequestRequestOptions} from '@octokit/types'
import {callAsyncFunction} from './async-function' import {callAsyncFunction} from './async-function'
@@ -44,7 +45,7 @@ async function main(): Promise<void> {
if (retryOpts) opts.retry = retryOpts if (retryOpts) opts.retry = retryOpts
if (requestOpts) opts.request = requestOpts if (requestOpts) opts.request = requestOpts
const github = getOctokit(token, opts, retry) const github = getOctokit(token, opts, retry, requestLog)
const script = core.getInput('script', {required: true}) const script = core.getInput('script', {required: true})
// Using property/value shorthand on `require` (e.g. `{require}`) causes compilation errors. // Using property/value shorthand on `require` (e.g. `{require}`) causes compilation errors.