mirror of
https://github.com/aws-actions/configure-aws-credentials.git
synced 2026-09-01 05:45:06 +09:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e6de054238 | |||
| ab3b2ba025 | |||
| fa8d6a57bb |
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
".release-please-manifest.json": "4.0.2",
|
".release-please-manifest.json": "4.0.2",
|
||||||
"package.json": "6.0.0",
|
"package.json": "6.0.0",
|
||||||
".": "6.2.2"
|
".": "6.2.3"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.
|
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)
|
## [6.2.2](https://github.com/aws-actions/configure-aws-credentials/compare/v6.2.1...v6.2.2) (2026-07-07)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -43559,7 +43559,7 @@ var require_dist_cjs16 = __commonJS({
|
|||||||
Object.setPrototypeOf(this, _MalformedPolicyDocumentException.prototype);
|
Object.setPrototypeOf(this, _MalformedPolicyDocumentException.prototype);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var PackedPolicyTooLargeException3 = class _PackedPolicyTooLargeException extends STSServiceException2 {
|
var PackedPolicyTooLargeException2 = class _PackedPolicyTooLargeException extends STSServiceException2 {
|
||||||
name = "PackedPolicyTooLargeException";
|
name = "PackedPolicyTooLargeException";
|
||||||
$fault = "client";
|
$fault = "client";
|
||||||
constructor(opts) {
|
constructor(opts) {
|
||||||
@@ -43885,7 +43885,7 @@ var require_dist_cjs16 = __commonJS({
|
|||||||
[_m4],
|
[_m4],
|
||||||
[0]
|
[0]
|
||||||
];
|
];
|
||||||
n0_registry5.registerError(PackedPolicyTooLargeException$2, PackedPolicyTooLargeException3);
|
n0_registry5.registerError(PackedPolicyTooLargeException$2, PackedPolicyTooLargeException2);
|
||||||
var RegionDisabledException$2 = [
|
var RegionDisabledException$2 = [
|
||||||
-3,
|
-3,
|
||||||
n05,
|
n05,
|
||||||
@@ -44653,7 +44653,7 @@ var require_dist_cjs16 = __commonJS({
|
|||||||
exports2.MalformedPolicyDocumentException$ = MalformedPolicyDocumentException$2;
|
exports2.MalformedPolicyDocumentException$ = MalformedPolicyDocumentException$2;
|
||||||
exports2.OutboundWebIdentityFederationDisabledException = OutboundWebIdentityFederationDisabledException;
|
exports2.OutboundWebIdentityFederationDisabledException = OutboundWebIdentityFederationDisabledException;
|
||||||
exports2.OutboundWebIdentityFederationDisabledException$ = OutboundWebIdentityFederationDisabledException$;
|
exports2.OutboundWebIdentityFederationDisabledException$ = OutboundWebIdentityFederationDisabledException$;
|
||||||
exports2.PackedPolicyTooLargeException = PackedPolicyTooLargeException3;
|
exports2.PackedPolicyTooLargeException = PackedPolicyTooLargeException2;
|
||||||
exports2.PackedPolicyTooLargeException$ = PackedPolicyTooLargeException$2;
|
exports2.PackedPolicyTooLargeException$ = PackedPolicyTooLargeException$2;
|
||||||
exports2.PolicyDescriptorType$ = PolicyDescriptorType$2;
|
exports2.PolicyDescriptorType$ = PolicyDescriptorType$2;
|
||||||
exports2.ProvidedContext$ = ProvidedContext$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 }));
|
const creds = await client.send(new import_client_sts2.AssumeRoleCommand({ ...params }));
|
||||||
return creds;
|
return creds;
|
||||||
} catch (error3) {
|
} 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.");
|
info("Session tag size is too large; dropping droppable tags and retrying.");
|
||||||
const droppableKeys = new Set(DROPPABLE_TAG_SOURCES.map((s2) => s2.key));
|
const droppableKeys = new Set(DROPPABLE_TAG_SOURCES.map((s2) => s2.key));
|
||||||
params.Tags = params.Tags?.filter((tag2) => !droppableKeys.has(tag2.Key ?? ""));
|
params.Tags = params.Tags?.filter((tag2) => !droppableKeys.has(tag2.Key ?? ""));
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "configure-aws-credentials",
|
"name": "configure-aws-credentials",
|
||||||
"version": "6.2.2",
|
"version": "6.2.3",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "configure-aws-credentials",
|
"name": "configure-aws-credentials",
|
||||||
"version": "6.2.2",
|
"version": "6.2.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^3.0.1",
|
"@actions/core": "^3.0.1",
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "configure-aws-credentials",
|
"name": "configure-aws-credentials",
|
||||||
"description": "A GitHub Action to configure AWS credentials",
|
"description": "A GitHub Action to configure AWS credentials",
|
||||||
"version": "6.2.2",
|
"version": "6.2.3",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"lint": "biome check --error-on-warnings ./src ./test && markdownlint -i node_modules -i CHANGELOG.md '**/*.md'",
|
"lint": "biome check --error-on-warnings ./src ./test && markdownlint -i node_modules -i CHANGELOG.md '**/*.md'",
|
||||||
|
|||||||
+2
-6
@@ -2,11 +2,7 @@ import assert from 'node:assert';
|
|||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import type { AssumeRoleCommandInput, STSClient, Tag } from '@aws-sdk/client-sts';
|
import type { AssumeRoleCommandInput, STSClient, Tag } from '@aws-sdk/client-sts';
|
||||||
import {
|
import { AssumeRoleCommand, AssumeRoleWithWebIdentityCommand } from '@aws-sdk/client-sts';
|
||||||
AssumeRoleCommand,
|
|
||||||
AssumeRoleWithWebIdentityCommand,
|
|
||||||
PackedPolicyTooLargeException,
|
|
||||||
} from '@aws-sdk/client-sts';
|
|
||||||
import type { CredentialsClient } from './CredentialsClient';
|
import type { CredentialsClient } from './CredentialsClient';
|
||||||
import { errorMessage, isDefined, readFileUtf8, sanitizeGitHubVariables } from './helpers';
|
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 }));
|
const creds = await client.send(new AssumeRoleCommand({ ...params }));
|
||||||
return creds;
|
return creds;
|
||||||
} catch (error) {
|
} 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.');
|
core.info('Session tag size is too large; dropping droppable tags and retrying.');
|
||||||
const droppableKeys = new Set(DROPPABLE_TAG_SOURCES.map((s) => s.key));
|
const droppableKeys = new Set(DROPPABLE_TAG_SOURCES.map((s) => s.key));
|
||||||
params.Tags = params.Tags?.filter((tag) => !droppableKeys.has(tag.Key ?? ''));
|
params.Tags = params.Tags?.filter((tag) => !droppableKeys.has(tag.Key ?? ''));
|
||||||
|
|||||||
+5
-5
@@ -3,7 +3,6 @@ import {
|
|||||||
AssumeRoleCommand,
|
AssumeRoleCommand,
|
||||||
AssumeRoleWithWebIdentityCommand,
|
AssumeRoleWithWebIdentityCommand,
|
||||||
GetCallerIdentityCommand,
|
GetCallerIdentityCommand,
|
||||||
PackedPolicyTooLargeException,
|
|
||||||
STSClient,
|
STSClient,
|
||||||
} from '@aws-sdk/client-sts';
|
} from '@aws-sdk/client-sts';
|
||||||
import { mockClient } from 'aws-sdk-client-mock';
|
import { mockClient } from 'aws-sdk-client-mock';
|
||||||
@@ -331,10 +330,11 @@ describe('Configure AWS Credentials', {}, () => {
|
|||||||
});
|
});
|
||||||
it('drops droppable tags and retries on PackedPolicyTooLargeException', {}, async () => {
|
it('drops droppable tags and retries on PackedPolicyTooLargeException', {}, async () => {
|
||||||
vi.mocked(core.getInput).mockImplementation(mocks.getInput(mocks.IAM_ASSUMEROLE_INPUTS));
|
vi.mocked(core.getInput).mockImplementation(mocks.getInput(mocks.IAM_ASSUMEROLE_INPUTS));
|
||||||
mockedSTSClient
|
// Reject with a plain error carrying only the `name`, NOT an instance of the SDK class. This
|
||||||
.on(AssumeRoleCommand)
|
// mirrors the bundled action, where the error can be deserialized by a second, non-identical
|
||||||
.rejectsOnce(new PackedPolicyTooLargeException({ message: 'too large', $metadata: {} }))
|
// copy of PackedPolicyTooLargeException so `instanceof` fails; the recovery must key off `name`.
|
||||||
.resolvesOnce(mocks.outputs.STS_CREDENTIALS);
|
const packedPolicyError = Object.assign(new Error('too large'), { name: 'PackedPolicyTooLargeException' });
|
||||||
|
mockedSTSClient.on(AssumeRoleCommand).rejectsOnce(packedPolicyError).resolvesOnce(mocks.outputs.STS_CREDENTIALS);
|
||||||
await run();
|
await run();
|
||||||
expect(core.info).toHaveBeenCalledWith('Session tag size is too large; dropping droppable tags and retrying.');
|
expect(core.info).toHaveBeenCalledWith('Session tag size is too large; dropping droppable tags and retrying.');
|
||||||
const retryInput = mockedSTSClient.commandCalls(AssumeRoleCommand)[1].args[0].input;
|
const retryInput = mockedSTSClient.commandCalls(AssumeRoleCommand)[1].args[0].input;
|
||||||
|
|||||||
Reference in New Issue
Block a user