mirror of
https://github.com/aws-actions/configure-aws-credentials.git
synced 2026-09-03 06:05:04 +09:00
chore: adjust cleanup build and some imports
This commit is contained in:
+5
-31
@@ -1,27 +1,4 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
||||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
||||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
||||||
}
|
|
||||||
Object.defineProperty(o, k2, desc);
|
|
||||||
}) : (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
o[k2] = m[k];
|
|
||||||
}));
|
|
||||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
||||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
||||||
}) : function(o, v) {
|
|
||||||
o["default"] = v;
|
|
||||||
});
|
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
|
||||||
if (mod && mod.__esModule) return mod;
|
|
||||||
var result = {};
|
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
||||||
__setModuleDefault(result, mod);
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
@@ -58,15 +35,12 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|||||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
||||||
};
|
|
||||||
exports.__esModule = true;
|
exports.__esModule = true;
|
||||||
exports.CredentialsClient = void 0;
|
exports.CredentialsClient = void 0;
|
||||||
var core = __importStar(require("@actions/core"));
|
var core_1 = require("@actions/core");
|
||||||
var client_sts_1 = require("@aws-sdk/client-sts");
|
var client_sts_1 = require("@aws-sdk/client-sts");
|
||||||
var node_http_handler_1 = require("@aws-sdk/node-http-handler");
|
var node_http_handler_1 = require("@aws-sdk/node-http-handler");
|
||||||
var https_proxy_agent_1 = __importDefault(require("https-proxy-agent"));
|
var https_proxy_agent_1 = require("https-proxy-agent");
|
||||||
var helpers_1 = require("./helpers");
|
var helpers_1 = require("./helpers");
|
||||||
var USER_AGENT = 'configure-aws-credentials-for-github-actions';
|
var USER_AGENT = 'configure-aws-credentials-for-github-actions';
|
||||||
var CredentialsClient = /** @class */ (function () {
|
var CredentialsClient = /** @class */ (function () {
|
||||||
@@ -75,11 +49,11 @@ var CredentialsClient = /** @class */ (function () {
|
|||||||
this.region = props.region;
|
this.region = props.region;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.info('No region provided, using global STS endpoint');
|
(0, core_1.info)('No region provided, using global STS endpoint');
|
||||||
}
|
}
|
||||||
if (props.proxyServer) {
|
if (props.proxyServer) {
|
||||||
core.info('Configurint proxy handler for STS client');
|
(0, core_1.info)('Configurint proxy handler for STS client');
|
||||||
var handler = (0, https_proxy_agent_1["default"])(props.proxyServer);
|
var handler = new https_proxy_agent_1.HttpsProxyAgent(props.proxyServer);
|
||||||
this.requestHandler = new node_http_handler_1.NodeHttpHandler({
|
this.requestHandler = new node_http_handler_1.NodeHttpHandler({
|
||||||
httpAgent: handler,
|
httpAgent: handler,
|
||||||
httpsAgent: handler
|
httpsAgent: handler
|
||||||
|
|||||||
+1
-24
@@ -1,30 +1,7 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
||||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
||||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
||||||
}
|
|
||||||
Object.defineProperty(o, k2, desc);
|
|
||||||
}) : (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
o[k2] = m[k];
|
|
||||||
}));
|
|
||||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
||||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
||||||
}) : function(o, v) {
|
|
||||||
o["default"] = v;
|
|
||||||
});
|
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
|
||||||
if (mod && mod.__esModule) return mod;
|
|
||||||
var result = {};
|
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
||||||
__setModuleDefault(result, mod);
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
exports.__esModule = true;
|
exports.__esModule = true;
|
||||||
exports.cleanup = void 0;
|
exports.cleanup = void 0;
|
||||||
var core = __importStar(require("@actions/core"));
|
var core = require("@actions/core");
|
||||||
var helpers_1 = require("../helpers");
|
var helpers_1 = require("../helpers");
|
||||||
/**
|
/**
|
||||||
* When the GitHub Actions job is done, clean up any environment variables that
|
* When the GitHub Actions job is done, clean up any environment variables that
|
||||||
|
|||||||
+1
-24
@@ -1,27 +1,4 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
||||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
||||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
||||||
}
|
|
||||||
Object.defineProperty(o, k2, desc);
|
|
||||||
}) : (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
o[k2] = m[k];
|
|
||||||
}));
|
|
||||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
||||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
||||||
}) : function(o, v) {
|
|
||||||
o["default"] = v;
|
|
||||||
});
|
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
|
||||||
if (mod && mod.__esModule) return mod;
|
|
||||||
var result = {};
|
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
||||||
__setModuleDefault(result, mod);
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
@@ -60,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|||||||
};
|
};
|
||||||
exports.__esModule = true;
|
exports.__esModule = true;
|
||||||
exports.isDefined = exports.errorMessage = exports.retryAndBackoff = exports.reset = exports.withsleep = exports.defaultSleep = exports.sanitizeGitHubVariables = exports.exportAccountId = exports.exportRegion = exports.exportCredentials = void 0;
|
exports.isDefined = exports.errorMessage = exports.retryAndBackoff = exports.reset = exports.withsleep = exports.defaultSleep = exports.sanitizeGitHubVariables = exports.exportAccountId = exports.exportRegion = exports.exportCredentials = void 0;
|
||||||
var core = __importStar(require("@actions/core"));
|
var core = require("@actions/core");
|
||||||
var client_sts_1 = require("@aws-sdk/client-sts");
|
var client_sts_1 = require("@aws-sdk/client-sts");
|
||||||
var MAX_TAG_VALUE_LENGTH = 256;
|
var MAX_TAG_VALUE_LENGTH = 256;
|
||||||
var SANITIZATION_CHARACTER = '_';
|
var SANITIZATION_CHARACTER = '_';
|
||||||
|
|||||||
+6
-32
@@ -2,42 +2,16 @@
|
|||||||
/******/ var __webpack_modules__ = ({
|
/******/ var __webpack_modules__ = ({
|
||||||
|
|
||||||
/***/ 3301:
|
/***/ 3301:
|
||||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
||||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
||||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
||||||
}
|
|
||||||
Object.defineProperty(o, k2, desc);
|
|
||||||
}) : (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
o[k2] = m[k];
|
|
||||||
}));
|
|
||||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
||||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
||||||
}) : function(o, v) {
|
|
||||||
o["default"] = v;
|
|
||||||
});
|
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
|
||||||
if (mod && mod.__esModule) return mod;
|
|
||||||
var result = {};
|
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
||||||
__setModuleDefault(result, mod);
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.CredentialsClient = void 0;
|
exports.CredentialsClient = void 0;
|
||||||
const core = __importStar(__nccwpck_require__(2186));
|
const core_1 = __nccwpck_require__(2186);
|
||||||
const client_sts_1 = __nccwpck_require__(2209);
|
const client_sts_1 = __nccwpck_require__(2209);
|
||||||
const node_http_handler_1 = __nccwpck_require__(8805);
|
const node_http_handler_1 = __nccwpck_require__(8805);
|
||||||
const https_proxy_agent_1 = __importDefault(__nccwpck_require__(7219));
|
const https_proxy_agent_1 = __nccwpck_require__(7219);
|
||||||
const helpers_1 = __nccwpck_require__(9787);
|
const helpers_1 = __nccwpck_require__(9787);
|
||||||
const USER_AGENT = 'configure-aws-credentials-for-github-actions';
|
const USER_AGENT = 'configure-aws-credentials-for-github-actions';
|
||||||
class CredentialsClient {
|
class CredentialsClient {
|
||||||
@@ -46,11 +20,11 @@ class CredentialsClient {
|
|||||||
this.region = props.region;
|
this.region = props.region;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.info('No region provided, using global STS endpoint');
|
(0, core_1.info)('No region provided, using global STS endpoint');
|
||||||
}
|
}
|
||||||
if (props.proxyServer) {
|
if (props.proxyServer) {
|
||||||
core.info('Configurint proxy handler for STS client');
|
(0, core_1.info)('Configurint proxy handler for STS client');
|
||||||
const handler = (0, https_proxy_agent_1.default)(props.proxyServer);
|
const handler = new https_proxy_agent_1.HttpsProxyAgent(props.proxyServer);
|
||||||
this.requestHandler = new node_http_handler_1.NodeHttpHandler({
|
this.requestHandler = new node_http_handler_1.NodeHttpHandler({
|
||||||
httpAgent: handler,
|
httpAgent: handler,
|
||||||
httpsAgent: handler,
|
httpsAgent: handler,
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc --project tsconfig.build.json",
|
"build": "tsc --project tsconfig.build.json",
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"package": "npm run build && ncc build --license THIRD-PARTY -o dist && tsc src/cleanup/index.ts --skipLibCheck --esModuleInterop --outdir dist/cleanup && copyup -E dist/THIRD-PARTY . && del-cli dist/THIRD-PARTY",
|
"package": "npm run build && ncc build --license THIRD-PARTY -o dist && tsc src/cleanup/index.ts --skipLibCheck --outdir dist/cleanup && copyup -E dist/THIRD-PARTY . && del-cli dist/THIRD-PARTY",
|
||||||
"test": "npm run lint && jest --verbose"
|
"test": "npm run lint && jest --verbose"
|
||||||
},
|
},
|
||||||
"author": {
|
"author": {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as core from '@actions/core';
|
import { info } from '@actions/core';
|
||||||
import { STSClient } from '@aws-sdk/client-sts';
|
import { STSClient } from '@aws-sdk/client-sts';
|
||||||
import { NodeHttpHandler } from '@aws-sdk/node-http-handler';
|
import { NodeHttpHandler } from '@aws-sdk/node-http-handler';
|
||||||
import proxy from 'https-proxy-agent';
|
import { HttpsProxyAgent } from 'https-proxy-agent';
|
||||||
import { errorMessage } from './helpers';
|
import { errorMessage } from './helpers';
|
||||||
|
|
||||||
const USER_AGENT = 'configure-aws-credentials-for-github-actions';
|
const USER_AGENT = 'configure-aws-credentials-for-github-actions';
|
||||||
@@ -20,11 +20,11 @@ export class CredentialsClient {
|
|||||||
if (props.region) {
|
if (props.region) {
|
||||||
this.region = props.region;
|
this.region = props.region;
|
||||||
} else {
|
} else {
|
||||||
core.info('No region provided, using global STS endpoint');
|
info('No region provided, using global STS endpoint');
|
||||||
}
|
}
|
||||||
if (props.proxyServer) {
|
if (props.proxyServer) {
|
||||||
core.info('Configurint proxy handler for STS client');
|
info('Configurint proxy handler for STS client');
|
||||||
const handler = proxy(props.proxyServer);
|
const handler = new HttpsProxyAgent(props.proxyServer);
|
||||||
this.requestHandler = new NodeHttpHandler({
|
this.requestHandler = new NodeHttpHandler({
|
||||||
httpAgent: handler,
|
httpAgent: handler,
|
||||||
httpsAgent: handler,
|
httpsAgent: handler,
|
||||||
|
|||||||
Reference in New Issue
Block a user