Compare commits

...

3 Commits

Author SHA1 Message Date
AWS SDKs and Tools bot e6de054238 chore(main): release 6.2.3 (#1878) 2026-07-22 11:31:37 -07:00
GitHub Actions ab3b2ba025 chore: Update dist 2026-07-22 18:25:55 +00:00
Tom Keller fa8d6a57bb fix: PackedPolicyTooLarge detection in STS tags (#1899)
Closes #1898.

Due to a bundling, checking for `error instanceof
PackedPolicyTooLargeException` fails. Instead we need to explicitly
check for `error.name`.
2026-07-22 11:25:24 -07:00
7 changed files with 23 additions and 19 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
{
".release-please-manifest.json": "4.0.2",
"package.json": "6.0.0",
".": "6.2.2"
".": "6.2.3"
}
+8
View File
@@ -2,6 +2,14 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## [6.2.3](https://github.com/aws-actions/configure-aws-credentials/compare/v6.2.2...v6.2.3) (2026-07-22)
### Bug Fixes
* attach git credentials before Tag Major Version push ([#1877](https://github.com/aws-actions/configure-aws-credentials/issues/1877)) ([9ae780b](https://github.com/aws-actions/configure-aws-credentials/commit/9ae780b171afa8c5a3a6a2d154a765b709492482))
* PackedPolicyTooLarge detection in STS tags ([#1899](https://github.com/aws-actions/configure-aws-credentials/issues/1899)) ([fa8d6a5](https://github.com/aws-actions/configure-aws-credentials/commit/fa8d6a57bbf44b34439fb080bbdadc7c92c285eb))
## [6.2.2](https://github.com/aws-actions/configure-aws-credentials/compare/v6.2.1...v6.2.2) (2026-07-07)
Generated Vendored
+4 -4
View File
@@ -43559,7 +43559,7 @@ var require_dist_cjs16 = __commonJS({
Object.setPrototypeOf(this, _MalformedPolicyDocumentException.prototype);
}
};
var PackedPolicyTooLargeException3 = class _PackedPolicyTooLargeException extends STSServiceException2 {
var PackedPolicyTooLargeException2 = class _PackedPolicyTooLargeException extends STSServiceException2 {
name = "PackedPolicyTooLargeException";
$fault = "client";
constructor(opts) {
@@ -43885,7 +43885,7 @@ var require_dist_cjs16 = __commonJS({
[_m4],
[0]
];
n0_registry5.registerError(PackedPolicyTooLargeException$2, PackedPolicyTooLargeException3);
n0_registry5.registerError(PackedPolicyTooLargeException$2, PackedPolicyTooLargeException2);
var RegionDisabledException$2 = [
-3,
n05,
@@ -44653,7 +44653,7 @@ var require_dist_cjs16 = __commonJS({
exports2.MalformedPolicyDocumentException$ = MalformedPolicyDocumentException$2;
exports2.OutboundWebIdentityFederationDisabledException = OutboundWebIdentityFederationDisabledException;
exports2.OutboundWebIdentityFederationDisabledException$ = OutboundWebIdentityFederationDisabledException$;
exports2.PackedPolicyTooLargeException = PackedPolicyTooLargeException3;
exports2.PackedPolicyTooLargeException = PackedPolicyTooLargeException2;
exports2.PackedPolicyTooLargeException$ = PackedPolicyTooLargeException$2;
exports2.PolicyDescriptorType$ = PolicyDescriptorType$2;
exports2.ProvidedContext$ = ProvidedContext$2;
@@ -73324,7 +73324,7 @@ async function assumeRoleWithCredentials(params, client) {
const creds = await client.send(new import_client_sts2.AssumeRoleCommand({ ...params }));
return creds;
} catch (error3) {
if (error3 instanceof import_client_sts2.PackedPolicyTooLargeException) {
if (error3?.name === "PackedPolicyTooLargeException") {
info("Session tag size is too large; dropping droppable tags and retrying.");
const droppableKeys = new Set(DROPPABLE_TAG_SOURCES.map((s2) => s2.key));
params.Tags = params.Tags?.filter((tag2) => !droppableKeys.has(tag2.Key ?? ""));
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "configure-aws-credentials",
"version": "6.2.2",
"version": "6.2.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "configure-aws-credentials",
"version": "6.2.2",
"version": "6.2.3",
"license": "MIT",
"dependencies": {
"@actions/core": "^3.0.1",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "configure-aws-credentials",
"description": "A GitHub Action to configure AWS credentials",
"version": "6.2.2",
"version": "6.2.3",
"scripts": {
"build": "tsc",
"lint": "biome check --error-on-warnings ./src ./test && markdownlint -i node_modules -i CHANGELOG.md '**/*.md'",
+2 -6
View File
@@ -2,11 +2,7 @@ import assert from 'node:assert';
import path from 'node:path';
import * as core from '@actions/core';
import type { AssumeRoleCommandInput, STSClient, Tag } from '@aws-sdk/client-sts';
import {
AssumeRoleCommand,
AssumeRoleWithWebIdentityCommand,
PackedPolicyTooLargeException,
} from '@aws-sdk/client-sts';
import { AssumeRoleCommand, AssumeRoleWithWebIdentityCommand } from '@aws-sdk/client-sts';
import type { CredentialsClient } from './CredentialsClient';
import { errorMessage, isDefined, readFileUtf8, sanitizeGitHubVariables } from './helpers';
@@ -65,7 +61,7 @@ async function assumeRoleWithCredentials(params: AssumeRoleCommandInput, client:
const creds = await client.send(new AssumeRoleCommand({ ...params }));
return creds;
} catch (error) {
if (error instanceof PackedPolicyTooLargeException) {
if ((error as { name?: string })?.name === 'PackedPolicyTooLargeException') {
core.info('Session tag size is too large; dropping droppable tags and retrying.');
const droppableKeys = new Set(DROPPABLE_TAG_SOURCES.map((s) => s.key));
params.Tags = params.Tags?.filter((tag) => !droppableKeys.has(tag.Key ?? ''));
+5 -5
View File
@@ -3,7 +3,6 @@ import {
AssumeRoleCommand,
AssumeRoleWithWebIdentityCommand,
GetCallerIdentityCommand,
PackedPolicyTooLargeException,
STSClient,
} from '@aws-sdk/client-sts';
import { mockClient } from 'aws-sdk-client-mock';
@@ -331,10 +330,11 @@ describe('Configure AWS Credentials', {}, () => {
});
it('drops droppable tags and retries on PackedPolicyTooLargeException', {}, async () => {
vi.mocked(core.getInput).mockImplementation(mocks.getInput(mocks.IAM_ASSUMEROLE_INPUTS));
mockedSTSClient
.on(AssumeRoleCommand)
.rejectsOnce(new PackedPolicyTooLargeException({ message: 'too large', $metadata: {} }))
.resolvesOnce(mocks.outputs.STS_CREDENTIALS);
// Reject with a plain error carrying only the `name`, NOT an instance of the SDK class. This
// mirrors the bundled action, where the error can be deserialized by a second, non-identical
// copy of PackedPolicyTooLargeException so `instanceof` fails; the recovery must key off `name`.
const packedPolicyError = Object.assign(new Error('too large'), { name: 'PackedPolicyTooLargeException' });
mockedSTSClient.on(AssumeRoleCommand).rejectsOnce(packedPolicyError).resolvesOnce(mocks.outputs.STS_CREDENTIALS);
await run();
expect(core.info).toHaveBeenCalledWith('Session tag size is too large; dropping droppable tags and retrying.');
const retryInput = mockedSTSClient.commandCalls(AssumeRoleCommand)[1].args[0].input;