Revert "Merge branch 'master' into v1-node16"

This reverts commit df03f9f89e, reversing
changes made to 5f641521a3.
This commit is contained in:
Tom Keller
2023-02-24 14:28:16 -08:00
parent df03f9f89e
commit afbf093795
8 changed files with 600 additions and 2305 deletions
-25
View File
@@ -3,7 +3,6 @@ const aws = require('aws-sdk');
const assert = require('assert');
const fs = require('fs');
const path = require('path');
const proxy = require('https-proxy-agent');
// Use 1hr as role duration when using session token or OIDC
// Otherwise, use the max duration of GitHub action (6hr)
@@ -261,26 +260,6 @@ const retryAndBackoff = async (fn, isRetryable, retries = 0, maxRetries = 12, ba
}
}
function configureProxy(proxyServer) {
const proxyFromEnv = process.env.HTTP_PROXY || process.env.http_proxy;
if (proxyFromEnv || proxyServer) {
let proxyToSet = null;
if (proxyServer){
console.log(`Setting proxy from actions input: ${proxyServer}`);
proxyToSet = proxyServer;
} else {
console.log(`Setting proxy from environment: ${proxyFromEnv}`);
proxyToSet = proxyFromEnv;
}
aws.config.update({
httpOptions: { agent: proxy(proxyToSet) }
});
}
}
async function run() {
try {
// Get inputs
@@ -299,7 +278,6 @@ async function run() {
const roleSkipSessionTaggingInput = core.getInput('role-skip-session-tagging', { required: false })|| 'false';
const roleSkipSessionTagging = roleSkipSessionTaggingInput.toLowerCase() === 'true';
const webIdentityTokenFile = core.getInput('web-identity-token-file', { required: false });
const proxyServer = core.getInput('http-proxy', { required: false });
if (!region.match(REGION_REGEX)) {
throw new Error(`Region is not valid: ${region}`);
@@ -329,9 +307,6 @@ async function run() {
exportCredentials({accessKeyId, secretAccessKey, sessionToken});
}
// Configures proxy
configureProxy(proxyServer);
// Attempt to load credentials from the GitHub OIDC provider.
// If a user provides an IAM Role Arn and DOESN'T provide an Access Key Id