chore: Update dist

This commit is contained in:
GitHub Actions
2025-02-08 00:25:25 +00:00
parent eb70354fb4
commit 16fec6080f
3 changed files with 40 additions and 0 deletions

1
dist/cleanup/helpers.d.ts generated vendored
View File

@@ -13,4 +13,5 @@ export declare function verifyKeys(creds: Partial<Credentials> | undefined): boo
export declare function retryAndBackoff<T>(fn: () => Promise<T>, isRetryable: boolean, maxRetries?: number, retries?: number, base?: number): Promise<T>;
export declare function errorMessage(error: unknown): string;
export declare function isDefined<T>(i: T | undefined | null): i is T;
export declare function areCredentialsValid(credentialsClient: CredentialsClient): Promise<boolean>;
export {};

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

@@ -46279,6 +46279,7 @@ exports.verifyKeys = verifyKeys;
exports.retryAndBackoff = retryAndBackoff;
exports.errorMessage = errorMessage;
exports.isDefined = isDefined;
exports.areCredentialsValid = areCredentialsValid;
const core = __importStar(__nccwpck_require__(7484));
const client_sts_1 = __nccwpck_require__(1695);
const MAX_TAG_VALUE_LENGTH = 256;
@@ -46403,6 +46404,19 @@ function isDefined(i) {
return i !== undefined && i !== null;
}
/* c8 ignore stop */
async function areCredentialsValid(credentialsClient) {
const client = credentialsClient.stsClient;
try {
const identity = await client.send(new client_sts_1.GetCallerIdentityCommand({}));
if (identity.Account) {
return true;
}
return false;
}
catch (_) {
return false;
}
}
/***/ }),

25
dist/index.js generated vendored
View File

@@ -275,6 +275,7 @@ exports.verifyKeys = verifyKeys;
exports.retryAndBackoff = retryAndBackoff;
exports.errorMessage = errorMessage;
exports.isDefined = isDefined;
exports.areCredentialsValid = areCredentialsValid;
const core = __importStar(__nccwpck_require__(7484));
const client_sts_1 = __nccwpck_require__(1695);
const MAX_TAG_VALUE_LENGTH = 256;
@@ -399,6 +400,19 @@ function isDefined(i) {
return i !== undefined && i !== null;
}
/* c8 ignore stop */
async function areCredentialsValid(credentialsClient) {
const client = credentialsClient.stsClient;
try {
const identity = await client.send(new client_sts_1.GetCallerIdentityCommand({}));
if (identity.Account) {
return true;
}
return false;
}
catch (_) {
return false;
}
}
//# sourceMappingURL=helpers.js.map
/***/ }),
@@ -492,6 +506,8 @@ async function run() {
let disableRetry = disableRetryInput.toLowerCase() === 'true';
const specialCharacterWorkaroundInput = core.getInput('special-characters-workaround', { required: false }) || 'false';
const specialCharacterWorkaround = specialCharacterWorkaroundInput.toLowerCase() === 'true';
const useExistingCredentialsInput = core.getInput('use-existing-credentials', { required: false }) || 'false';
const useExistingCredentials = useExistingCredentialsInput.toLowerCase() === 'true';
let maxRetries = Number.parseInt(core.getInput('retry-max-attempts', { required: false })) || 12;
switch (true) {
case specialCharacterWorkaround:
@@ -537,6 +553,15 @@ async function run() {
const credentialsClient = new CredentialsClient_1.CredentialsClient({ region, proxyServer });
let sourceAccountId;
let webIdentityToken;
//if the user wants to attempt to use existing credentials, check if we have some already
if (useExistingCredentials) {
const validCredentials = await (0, helpers_1.areCredentialsValid)(credentialsClient);
if (validCredentials) {
core.notice('Pre-existing credentials are valid. No need to generate new ones.');
return;
}
core.notice('No valid credentials exist. Running as normal.');
}
// If OIDC is being used, generate token
// Else, export credentials provided as input
if (useGitHubOIDCProvider()) {