From 351d894493fd3289754a5471c0892ba92fa0abe2 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 11 Sep 2025 20:33:40 +0000 Subject: [PATCH] chore: Update dist --- dist/index.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dist/index.js b/dist/index.js index aece591..0345903 100644 --- a/dist/index.js +++ b/dist/index.js @@ -698,6 +698,15 @@ async function run() { .map((s) => s.trim()); const forceSkipOidc = (0, helpers_1.getBooleanInput)('force-skip-oidc', { required: false }); const noProxy = core.getInput('no-proxy', { required: false }); + const globalTimeout = Number.parseInt(core.getInput('action-timeout-s', { required: false })) || 0; + let timeoutId; + if (globalTimeout > 0) { + core.info(`Setting a global timeout of ${globalTimeout} seconds for the action`); + timeoutId = setTimeout(() => { + core.setFailed(`Action timed out after ${globalTimeout} seconds`); + process.exit(1); + }, globalTimeout * 1000); + } if (forceSkipOidc && roleToAssume && !AccessKeyId && !webIdentityTokenFile) { throw new Error("If 'force-skip-oidc' is true and 'role-to-assume' is set, 'aws-access-key-id' or 'web-identity-token-file' must be set"); } @@ -752,6 +761,8 @@ async function run() { const validCredentials = await (0, helpers_1.areCredentialsValid)(credentialsClient); if (validCredentials) { core.notice('Pre-existing credentials are valid. No need to generate new ones.'); + if (timeoutId) + clearTimeout(timeoutId); return; } core.notice('No valid credentials exist. Running as normal.'); @@ -826,6 +837,9 @@ async function run() { else { core.info('Proceeding with IAM user credentials'); } + // Clear timeout on successful completion + if (timeoutId) + clearTimeout(timeoutId); } catch (error) { core.setFailed((0, helpers_1.errorMessage)(error));