mirror of
https://github.com/actions/hello-world-javascript-action.git
synced 2025-12-18 08:16:49 +00:00
Add node modules and package files
This commit is contained in:
10
node_modules/@octokit/rest/plugins/authentication-deprecated/before-request.js
generated
vendored
10
node_modules/@octokit/rest/plugins/authentication-deprecated/before-request.js
generated
vendored
@@ -10,20 +10,20 @@ function authenticationBeforeRequest (state, options) {
|
||||
|
||||
if (state.auth.type === 'basic') {
|
||||
const hash = btoa(`${state.auth.username}:${state.auth.password}`)
|
||||
options.headers['authorization'] = `Basic ${hash}`
|
||||
options.headers.authorization = `Basic ${hash}`
|
||||
return
|
||||
}
|
||||
|
||||
if (state.auth.type === 'token') {
|
||||
options.headers['authorization'] = `token ${state.auth.token}`
|
||||
options.headers.authorization = `token ${state.auth.token}`
|
||||
return
|
||||
}
|
||||
|
||||
if (state.auth.type === 'app') {
|
||||
options.headers['authorization'] = `Bearer ${state.auth.token}`
|
||||
const acceptHeaders = options.headers['accept'].split(',')
|
||||
options.headers.authorization = `Bearer ${state.auth.token}`
|
||||
const acceptHeaders = options.headers.accept.split(',')
|
||||
.concat('application/vnd.github.machine-man-preview+json')
|
||||
options.headers['accept'] = uniq(acceptHeaders).filter(Boolean).join(',')
|
||||
options.headers.accept = uniq(acceptHeaders).filter(Boolean).join(',')
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
14
node_modules/@octokit/rest/plugins/authentication/before-request.js
generated
vendored
14
node_modules/@octokit/rest/plugins/authentication/before-request.js
generated
vendored
@@ -6,13 +6,13 @@ const withAuthorizationPrefix = require('./with-authorization-prefix')
|
||||
|
||||
function authenticationBeforeRequest (state, options) {
|
||||
if (typeof state.auth === 'string') {
|
||||
options.headers['authorization'] = withAuthorizationPrefix(state.auth)
|
||||
options.headers.authorization = withAuthorizationPrefix(state.auth)
|
||||
|
||||
// https://developer.github.com/v3/previews/#integrations
|
||||
if (/^bearer /i.test(state.auth) && !/machine-man/.test(options.headers['accept'])) {
|
||||
const acceptHeaders = options.headers['accept'].split(',')
|
||||
if (/^bearer /i.test(state.auth) && !/machine-man/.test(options.headers.accept)) {
|
||||
const acceptHeaders = options.headers.accept.split(',')
|
||||
.concat('application/vnd.github.machine-man-preview+json')
|
||||
options.headers['accept'] = acceptHeaders.filter(Boolean).join(',')
|
||||
options.headers.accept = acceptHeaders.filter(Boolean).join(',')
|
||||
}
|
||||
|
||||
return
|
||||
@@ -20,7 +20,7 @@ function authenticationBeforeRequest (state, options) {
|
||||
|
||||
if (state.auth.username) {
|
||||
const hash = btoa(`${state.auth.username}:${state.auth.password}`)
|
||||
options.headers['authorization'] = `Basic ${hash}`
|
||||
options.headers.authorization = `Basic ${hash}`
|
||||
if (state.otp) {
|
||||
options.headers['x-github-otp'] = state.otp
|
||||
}
|
||||
@@ -40,7 +40,7 @@ function authenticationBeforeRequest (state, options) {
|
||||
// as well as "/applications/123/tokens/token456"
|
||||
if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
|
||||
const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`)
|
||||
options.headers['authorization'] = `Basic ${hash}`
|
||||
options.headers.authorization = `Basic ${hash}`
|
||||
return
|
||||
}
|
||||
|
||||
@@ -56,6 +56,6 @@ function authenticationBeforeRequest (state, options) {
|
||||
})
|
||||
|
||||
.then((authorization) => {
|
||||
options.headers['authorization'] = withAuthorizationPrefix(authorization)
|
||||
options.headers.authorization = withAuthorizationPrefix(authorization)
|
||||
})
|
||||
}
|
||||
|
||||
2
node_modules/@octokit/rest/plugins/log/index.js
generated
vendored
2
node_modules/@octokit/rest/plugins/log/index.js
generated
vendored
@@ -2,7 +2,7 @@ module.exports = octokitDebug
|
||||
|
||||
function octokitDebug (octokit) {
|
||||
octokit.hook.wrap('request', (request, options) => {
|
||||
octokit.log.debug(`request`, options)
|
||||
octokit.log.debug('request', options)
|
||||
const start = Date.now()
|
||||
const requestOptions = octokit.request.endpoint.parse(options)
|
||||
const path = requestOptions.url.replace(options.baseUrl, '')
|
||||
|
||||
Reference in New Issue
Block a user