@octokit/action
Advanced tools
Comparing version 3.11.2 to 3.12.0
@@ -9,9 +9,70 @@ 'use strict'; | ||
var pluginRestEndpointMethods = require('@octokit/plugin-rest-endpoint-methods'); | ||
var httpsProxyAgent = require('https-proxy-agent'); | ||
const VERSION = "3.11.2"; | ||
function ownKeys(object, enumerableOnly) { | ||
var keys = Object.keys(object); | ||
const Octokit = core.Octokit.plugin(pluginPaginateRest.paginateRest, pluginRestEndpointMethods.legacyRestEndpointMethods).defaults({ | ||
if (Object.getOwnPropertySymbols) { | ||
var symbols = Object.getOwnPropertySymbols(object); | ||
if (enumerableOnly) { | ||
symbols = symbols.filter(function (sym) { | ||
return Object.getOwnPropertyDescriptor(object, sym).enumerable; | ||
}); | ||
} | ||
keys.push.apply(keys, symbols); | ||
} | ||
return keys; | ||
} | ||
function _objectSpread2(target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i] != null ? arguments[i] : {}; | ||
if (i % 2) { | ||
ownKeys(Object(source), true).forEach(function (key) { | ||
_defineProperty(target, key, source[key]); | ||
}); | ||
} else if (Object.getOwnPropertyDescriptors) { | ||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); | ||
} else { | ||
ownKeys(Object(source)).forEach(function (key) { | ||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); | ||
}); | ||
} | ||
} | ||
return target; | ||
} | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
const VERSION = "3.12.0"; | ||
const DEFAULTS = { | ||
authStrategy: authAction.createActionAuth, | ||
baseUrl: getApiBaseUrl(), | ||
userAgent: `octokit-action.js/${VERSION}` | ||
}; | ||
const Octokit = core.Octokit.plugin(pluginPaginateRest.paginateRest, pluginRestEndpointMethods.legacyRestEndpointMethods).defaults(function buildDefaults(options) { | ||
return _objectSpread2(_objectSpread2(_objectSpread2({}, DEFAULTS), options), {}, { | ||
request: _objectSpread2({ | ||
agent: getHttpsProxyAgent() | ||
}, options.request) | ||
}); | ||
}); | ||
@@ -24,3 +85,9 @@ | ||
function getHttpsProxyAgent() { | ||
const proxy = process.env["HTTPS_PROXY"] || process.env["https_proxy"]; | ||
if (!proxy) return undefined; | ||
return new httpsProxyAgent.HttpsProxyAgent(proxy); | ||
} | ||
exports.Octokit = Octokit; | ||
//# sourceMappingURL=index.js.map |
@@ -6,6 +6,17 @@ import { Octokit as Core } from "@octokit/core"; | ||
import { VERSION } from "./version"; | ||
export const Octokit = Core.plugin(paginateRest, legacyRestEndpointMethods).defaults({ | ||
import { HttpsProxyAgent } from "https-proxy-agent"; | ||
const DEFAULTS = { | ||
authStrategy: createActionAuth, | ||
baseUrl: getApiBaseUrl(), | ||
userAgent: `octokit-action.js/${VERSION}`, | ||
}; | ||
export const Octokit = Core.plugin(paginateRest, legacyRestEndpointMethods).defaults(function buildDefaults(options) { | ||
return { | ||
...DEFAULTS, | ||
...options, | ||
request: { | ||
agent: getHttpsProxyAgent(), | ||
...options.request | ||
}, | ||
}; | ||
}); | ||
@@ -16,1 +27,7 @@ function getApiBaseUrl() { | ||
} | ||
function getHttpsProxyAgent() { | ||
const proxy = process.env["HTTPS_PROXY"] || process.env["https_proxy"]; | ||
if (!proxy) | ||
return undefined; | ||
return new HttpsProxyAgent(proxy); | ||
} |
@@ -1,1 +0,1 @@ | ||
export const VERSION = "3.11.2"; | ||
export const VERSION = "3.12.0"; |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "3.11.2"; | ||
export declare const VERSION = "3.12.0"; |
{ | ||
"name": "@octokit/action", | ||
"description": "GitHub API client for GitHub Actions", | ||
"version": "3.11.2", | ||
"version": "3.12.0", | ||
"license": "MIT", | ||
@@ -25,3 +25,4 @@ "files": [ | ||
"@octokit/plugin-rest-endpoint-methods": "5.5.2", | ||
"@octokit/types": "^6.16.1" | ||
"@octokit/types": "^6.16.1", | ||
"https-proxy-agent": "^5.0.0" | ||
}, | ||
@@ -28,0 +29,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12698
112
6
7
2
+ Addedhttps-proxy-agent@^5.0.0
+ Addedagent-base@6.0.2(transitive)
+ Addeddebug@4.3.7(transitive)
+ Addedhttps-proxy-agent@5.0.1(transitive)
+ Addedms@2.1.3(transitive)