chore: adjust cleanup build and some imports

This commit is contained in:
peterwoodworth
2023-03-22 16:37:58 -07:00
parent 3088522ce8
commit fc80f28dba
6 changed files with 19 additions and 117 deletions

36
dist/cleanup/CredentialsClient.js generated vendored
View File

@@ -1,27 +1,4 @@
"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) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
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 };
}
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
exports.__esModule = true;
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 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 USER_AGENT = 'configure-aws-credentials-for-github-actions';
var CredentialsClient = /** @class */ (function () {
@@ -75,11 +49,11 @@ var CredentialsClient = /** @class */ (function () {
this.region = props.region;
}
else {
core.info('No region provided, using global STS endpoint');
(0, core_1.info)('No region provided, using global STS endpoint');
}
if (props.proxyServer) {
core.info('Configurint proxy handler for STS client');
var handler = (0, https_proxy_agent_1["default"])(props.proxyServer);
(0, core_1.info)('Configurint proxy handler for STS client');
var handler = new https_proxy_agent_1.HttpsProxyAgent(props.proxyServer);
this.requestHandler = new node_http_handler_1.NodeHttpHandler({
httpAgent: handler,
httpsAgent: handler

25
dist/cleanup/cleanup/index.js generated vendored
View File

@@ -1,30 +1,7 @@
"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.cleanup = void 0;
var core = __importStar(require("@actions/core"));
var core = require("@actions/core");
var helpers_1 = require("../helpers");
/**
* When the GitHub Actions job is done, clean up any environment variables that

25
dist/cleanup/helpers.js generated vendored
View File

@@ -1,27 +1,4 @@
"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) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
@@ -60,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
};
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;
var core = __importStar(require("@actions/core"));
var core = require("@actions/core");
var client_sts_1 = require("@aws-sdk/client-sts");
var MAX_TAG_VALUE_LENGTH = 256;
var SANITIZATION_CHARACTER = '_';

38
dist/index.js generated vendored
View File

@@ -2,42 +2,16 @@
/******/ var __webpack_modules__ = ({
/***/ 3301:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"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 }));
exports.CredentialsClient = void 0;
const core = __importStar(__nccwpck_require__(2186));
const core_1 = __nccwpck_require__(2186);
const client_sts_1 = __nccwpck_require__(2209);
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 USER_AGENT = 'configure-aws-credentials-for-github-actions';
class CredentialsClient {
@@ -46,11 +20,11 @@ class CredentialsClient {
this.region = props.region;
}
else {
core.info('No region provided, using global STS endpoint');
(0, core_1.info)('No region provided, using global STS endpoint');
}
if (props.proxyServer) {
core.info('Configurint proxy handler for STS client');
const handler = (0, https_proxy_agent_1.default)(props.proxyServer);
(0, core_1.info)('Configurint proxy handler for STS client');
const handler = new https_proxy_agent_1.HttpsProxyAgent(props.proxyServer);
this.requestHandler = new node_http_handler_1.NodeHttpHandler({
httpAgent: handler,
httpsAgent: handler,

View File

@@ -4,7 +4,7 @@
"scripts": {
"build": "tsc --project tsconfig.build.json",
"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"
},
"author": {

View File

@@ -1,7 +1,7 @@
import * as core from '@actions/core';
import { info } from '@actions/core';
import { STSClient } from '@aws-sdk/client-sts';
import { NodeHttpHandler } from '@aws-sdk/node-http-handler';
import proxy from 'https-proxy-agent';
import { HttpsProxyAgent } from 'https-proxy-agent';
import { errorMessage } from './helpers';
const USER_AGENT = 'configure-aws-credentials-for-github-actions';
@@ -20,11 +20,11 @@ export class CredentialsClient {
if (props.region) {
this.region = props.region;
} else {
core.info('No region provided, using global STS endpoint');
info('No region provided, using global STS endpoint');
}
if (props.proxyServer) {
core.info('Configurint proxy handler for STS client');
const handler = proxy(props.proxyServer);
info('Configurint proxy handler for STS client');
const handler = new HttpsProxyAgent(props.proxyServer);
this.requestHandler = new NodeHttpHandler({
httpAgent: handler,
httpsAgent: handler,