Compare commits

...

56 Commits

Author SHA1 Message Date
Alisha Kulkarni f24d7193d9 Merge pull request #1331 from aws-actions/release-please--branches--main--components--configure-aws-credentials
chore(main): release 4.2.0
2025-05-06 13:18:00 -07:00
Alisha Kulkarni f6095d9dc4 Merge branch 'main' into release-please--branches--main--components--configure-aws-credentials 2025-05-06 13:16:29 -07:00
dependabot[bot] df1fa04984 chore(deps-dev): bump memfs from 4.17.0 to 4.17.1 (#1348)
Bumps [memfs](https://github.com/streamich/memfs) from 4.17.0 to 4.17.1.
- [Release notes](https://github.com/streamich/memfs/releases)
- [Changelog](https://github.com/streamich/memfs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/streamich/memfs/compare/v4.17.0...v4.17.1)

---
updated-dependencies:
- dependency-name: memfs
  dependency-version: 4.17.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-06 03:48:41 +00:00
dependabot[bot] 1c397386a2 chore(deps-dev): bump @types/node from 22.15.3 to 22.15.11 (#1345)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.15.3 to 22.15.11.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 22.15.11
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-06 03:46:27 +00:00
AWS SDKs and Tools bot 21e0c4b1ca chore(main): release 4.2.0 2025-05-05 20:44:51 -07:00
GitHub Actions b0f2baf098 chore: Update dist 2025-05-06 03:44:51 +00:00
dependabot[bot] 4320d1b180 chore(deps): bump @aws-sdk/client-sts from 3.798.0 to 3.803.0 (#1346)
Bumps [@aws-sdk/client-sts](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-sts) from 3.798.0 to 3.803.0.
- [Release notes](https://github.com/aws/aws-sdk-js-v3/releases)
- [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-sts/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.803.0/clients/client-sts)

---
updated-dependencies:
- dependency-name: "@aws-sdk/client-sts"
  dependency-version: 3.803.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-06 03:44:09 +00:00
dependabot[bot] 5d1959cbc9 chore(deps): bump vite from 6.3.2 to 6.3.4 (#1344)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 6.3.2 to 6.3.4.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.3.4/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 6.3.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-30 17:43:18 +00:00
GitHub Actions 3ecfae8a2c chore: Update dist 2025-04-29 03:22:08 +00:00
dependabot[bot] 2f26d75abd chore(deps): bump @aws-sdk/client-sts from 3.787.0 to 3.798.0 (#1342)
Bumps [@aws-sdk/client-sts](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-sts) from 3.787.0 to 3.798.0.
- [Release notes](https://github.com/aws/aws-sdk-js-v3/releases)
- [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-sts/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.798.0/clients/client-sts)

---
updated-dependencies:
- dependency-name: "@aws-sdk/client-sts"
  dependency-version: 3.798.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-29 03:21:33 +00:00
dependabot[bot] 658557f884 chore(deps-dev): bump @types/node from 22.14.1 to 22.15.3 (#1341)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.14.1 to 22.15.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 22.15.3
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-29 03:19:12 +00:00
GitHub Actions f157a6574f chore: Update dist 2025-04-25 23:12:05 +00:00
Tom Keller 9e38641911 fix: role chaning on mulitple runs (#1340) 2025-04-25 16:11:28 -07:00
Tom Keller 2c168adcae feat: support action inputs as environment variables (#1338)
* support action inputs as environment variables

* update dist

* fix: update tsconfig for package step

* fix: update environment variable setting method

* fix: make biome happy

---------

Co-authored-by: Michael Lehmann <lehmanmj@amazon.com>
2025-04-25 13:15:03 -07:00
GitHub Actions 4d5f2395c0 chore: Update dist 2025-04-24 22:55:35 +00:00
Michael Lehmann a4f326760c Merge pull request #1337 from aws-actions/output-expiration
feat: add Expiration field to Outputs
2025-04-24 15:55:00 -07:00
Michael Lehmann 93edf43b3a document outputs in readme 2025-04-24 15:42:59 -07:00
Michael Lehmann fe54dce1bb update dist with changes 2025-04-24 15:05:57 -07:00
Michael Lehmann 423f4e15fb Add Expiration field to output 2025-04-24 14:14:16 -07:00
Michael Lehmann 11e58be8bc Merge pull request #1336 from aws-actions/lehmanmj-patch-1
chore: Update README.md
2025-04-24 12:16:29 -07:00
Michael Lehmann 7f5e3139fe Update README.md
update readme.md to provide a suggestion for altering the role-session-name for easier auditability
2025-04-24 12:09:12 -07:00
Michael Lehmann 5a0cf0167f Merge pull request #1334 from aws-actions/lehmanmj-patch-1
feat: Document role-duration-seconds range
2025-04-23 10:50:01 -07:00
Michael Lehmann adb43a2cd3 Update README.md 2025-04-23 10:34:14 -07:00
dependabot[bot] e62ae06aa8 chore(deps-dev): bump @types/node from 22.13.1 to 22.14.1 (#1326)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.13.1 to 22.14.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 22.14.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-22 23:45:50 +00:00
dependabot[bot] 66d7591932 chore(deps-dev): bump typescript from 5.7.3 to 5.8.3 (#1323)
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.7.3 to 5.8.3.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release-publish.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.7.3...v5.8.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-version: 5.8.3
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-22 23:43:22 +00:00
GitHub Actions 76dfa67953 chore: Update dist 2025-04-22 23:41:36 +00:00
dependabot[bot] ab246ce5fb chore(deps): bump esbuild, @vitest/coverage-v8 and vitest (#1333)
Bumps [esbuild](https://github.com/evanw/esbuild) to 0.25.2 and updates ancestor dependencies [esbuild](https://github.com/evanw/esbuild), [@vitest/coverage-v8](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8) and [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest). These dependencies need to be updated together.


Updates `esbuild` from 0.21.5 to 0.25.2
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG-2024.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.21.5...v0.25.2)

Updates `@vitest/coverage-v8` from 2.1.9 to 3.1.2
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v3.1.2/packages/coverage-v8)

Updates `vitest` from 2.1.9 to 3.1.2
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v3.1.2/packages/vitest)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-version: 0.25.2
  dependency-type: indirect
- dependency-name: "@vitest/coverage-v8"
  dependency-version: 3.1.2
  dependency-type: direct:development
- dependency-name: vitest
  dependency-version: 3.1.2
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-22 23:40:59 +00:00
GitHub Actions ca537c9527 chore: Update dist 2025-04-22 23:39:29 +00:00
dependabot[bot] 72a198126f chore(deps): bump @aws-sdk/client-sts from 3.741.0 to 3.787.0 (#1325)
Bumps [@aws-sdk/client-sts](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-sts) from 3.741.0 to 3.787.0.
- [Release notes](https://github.com/aws/aws-sdk-js-v3/releases)
- [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-sts/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.787.0/clients/client-sts)

---
updated-dependencies:
- dependency-name: "@aws-sdk/client-sts"
  dependency-version: 3.787.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-22 23:38:50 +00:00
dependabot[bot] 203a39c651 chore(deps): bump vite from 5.4.14 to 5.4.18 (#1332)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.14 to 5.4.18.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.18/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.18/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 5.4.18
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-22 23:36:33 +00:00
Michael Lehmann c401b8a98c Merge pull request #1330 from aws-actions/dependabot-and-build-test
fix: make sure action builds, also fix dependabot autoapprove
2025-04-22 16:34:27 -07:00
Michael Lehmann 27e906a655 make sure action builds, also fix dependabot autoapprove 2025-04-22 16:20:34 -07:00
Alisha Kulkarni 483d6b517a Merge pull request #1329 from aws-actions/alikulka-patch-1
chore: Update README.md
2025-04-17 14:56:31 -07:00
Alisha Kulkarni c7765366a4 Update README.md
Updated version tags in examples to reflect the latest semantic version.
2025-04-17 13:35:40 -07:00
AWS SDKs and Tools bot ececac1a45 chore(main): release 4.1.0 (#1282)
Co-authored-by: Michael Lehmann <lehmanmj@amazon.com>
2025-02-10 15:09:08 -08:00
GitHub Actions 16fec6080f chore: Update dist 2025-02-08 00:25:25 +00:00
Michael Lehmann eb70354fb4 feat: idempotent fetch (#1289)
* Add functionality to re-use existing credentials

* Finish adding use-existing-credentials logic

* Add testing for use-existing-credentials

* Update README

* feat: finalize use-exisiting-credentials feature

---------

Co-authored-by: Tom Keller <kellertk@amazon.com>
2025-02-07 16:24:45 -08:00
dependabot[bot] 3478c15aa1 chore(deps-dev): bump memfs from 4.14.0 to 4.17.0 (#1250)
Bumps [memfs](https://github.com/streamich/memfs) from 4.14.0 to 4.17.0.
- [Release notes](https://github.com/streamich/memfs/releases)
- [Changelog](https://github.com/streamich/memfs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/streamich/memfs/compare/v4.14.0...v4.17.0)

---
updated-dependencies:
- dependency-name: memfs
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tom Keller <1083460+kellertk@users.noreply.github.com>
2025-02-05 01:22:06 +00:00
GitHub Actions a69d38c39d chore: Update dist 2025-02-05 01:20:28 +00:00
dependabot[bot] 6b1d0f829d chore(deps-dev): bump @smithy/property-provider from 3.1.8 to 4.0.1 (#1246)
Bumps [@smithy/property-provider](https://github.com/awslabs/smithy-typescript/tree/HEAD/packages/property-provider) from 3.1.8 to 4.0.1.
- [Release notes](https://github.com/awslabs/smithy-typescript/releases)
- [Changelog](https://github.com/smithy-lang/smithy-typescript/blob/main/packages/property-provider/CHANGELOG.md)
- [Commits](https://github.com/awslabs/smithy-typescript/commits/@smithy/property-provider@4.0.1/packages/property-provider)

---
updated-dependencies:
- dependency-name: "@smithy/property-provider"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tom Keller <1083460+kellertk@users.noreply.github.com>
2025-02-05 01:19:53 +00:00
Tom Keller f021516513 chore: remove role session name 2025-02-04 17:18:15 -08:00
dependabot[bot] 1c8dbbcc02 chore(deps-dev): bump @vercel/ncc from 0.38.2 to 0.38.3 (#1204)
Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.38.2 to 0.38.3.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.38.2...0.38.3)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tom Keller <1083460+kellertk@users.noreply.github.com>
2025-02-05 01:13:40 +00:00
Tom Keller ce290d67fe chore: change dependabot role session name 2025-02-04 17:12:00 -08:00
Tom Keller 1780ebd97b chore: create one-off test for CAWSC 2025-02-04 17:06:10 -08:00
GitHub Actions a02ef26683 chore: Update dist 2025-02-05 00:30:13 +00:00
dependabot[bot] 5fbd2e409b chore(deps-dev): bump typescript from 5.6.3 to 5.7.3 (#1247)
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.6.3 to 5.7.3.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.6.3...v5.7.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Lehmann <lehmanmj@amazon.com>
2025-02-05 00:29:37 +00:00
Michael Lehmann f0af89b102 fix: Dependabot autoapprove id-token write permission (#1285)
* Fix automerge action syntax

* Fix typo

* Fix typo

* Add brackets

* add ID token permission

---------

Co-authored-by: Tom Keller <1083460+kellertk@users.noreply.github.com>
2025-02-05 00:27:51 +00:00
Michael Lehmann b9ee51dc60 fix: Dependabot autoapprove (#1284)
* Fix automerge action syntax

* Fix typo

* Fix typo

* Add brackets
2025-02-05 00:23:12 +00:00
GitHub Actions 66c00faf39 chore: Update dist 2025-02-04 23:06:04 +00:00
Tom Keller 134d71efe0 fix: build failure due to tests (#1283) 2025-02-04 15:05:30 -08:00
dependabot[bot] b8ef615781 chore(deps): bump undici from 5.28.4 to 5.28.5 (#1271)
Bumps [undici](https://github.com/nodejs/undici) from 5.28.4 to 5.28.5.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.28.4...v5.28.5)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-04 14:34:15 -08:00
dependabot[bot] e5b9735585 chore(deps-dev): bump @types/node from 22.9.0 to 22.13.1 (#1277)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.9.0 to 22.13.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-04 14:30:57 -08:00
dependabot[bot] 79ebbb3141 chore(deps): bump @aws-sdk/client-sts from 3.682.0 to 3.741.0 (#1278)
Bumps [@aws-sdk/client-sts](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-sts) from 3.682.0 to 3.741.0.
- [Release notes](https://github.com/aws/aws-sdk-js-v3/releases)
- [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-sts/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.741.0/clients/client-sts)

---
updated-dependencies:
- dependency-name: "@aws-sdk/client-sts"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-04 14:18:13 -08:00
dependabot[bot] 7f029f3507 chore(deps-dev): bump vitest and @vitest/coverage-v8
Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) and [@vitest/coverage-v8](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8). These dependencies needed to be updated together.

Updates `vitest` from 2.1.4 to 2.1.9
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v2.1.9/packages/vitest)

Updates `@vitest/coverage-v8` from 2.1.4 to 2.1.9
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v2.1.9/packages/coverage-v8)

---
updated-dependencies:
- dependency-name: vitest
  dependency-type: direct:development
- dependency-name: "@vitest/coverage-v8"
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-04 14:15:29 -08:00
Michael Lehmann 39fd91c08e fix: typo (#1281)
* Fix automerge action syntax

* Fix typo

---------

Co-authored-by: Tom Keller <1083460+kellertk@users.noreply.github.com>
2025-02-04 22:10:35 +00:00
Michael Lehmann cf624fbdad Fix automerge action syntax 2025-02-04 12:02:34 -08:00
29 changed files with 10848 additions and 14886 deletions
+1 -4
View File
@@ -9,10 +9,7 @@ jobs:
contents: write
pull-requests: write
id-token: write
if: >-
github.event.review.state == 'approved' &&
github.event.repository == 'aws/configure-aws-credentials' &&
(github.event.review.author_association == 'OWNER' || github.event.review.user.login == 'aws-sdk-osds')
if: ${{ github.event.review.state == 'approved' && github.repository == 'aws-actions/configure-aws-credentials' && (github.event.review.author_association == 'OWNER' || github.event.review.author_association == 'MEMBER' || github.event.review.user.login == 'aws-sdk-osds') }}
runs-on: ubuntu-latest
steps:
- name: Configure AWS credentials
+20
View File
@@ -0,0 +1,20 @@
name: Test Configure AWS Credential
on:
workflow_dispatch:
jobs:
cawsc:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: CAWSC
uses: aws-actions/configure-aws-credentials@main
with:
aws-region: us-west-2
role-to-assume: ${{ secrets.SECRETS_AWS_PACKAGING_ROLE_TO_ASSUME }}
role-duration-seconds: 900
role-session-name: TestCAWSC
- name: Whoami
run: |
aws sts get-caller-identity
+8 -4
View File
@@ -1,11 +1,16 @@
name: Dependabot auto-approve
on: pull_request
on:
pull_request:
workflow_dispatch:
permissions:
pull-requests: write
id-token: write
contents: read
jobs:
dependabot:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'aws/configure-aws-credentials'
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'aws-actions/configure-aws-credentials' }}
steps:
- name: Get Metadata
id: dependabot-metadata
@@ -16,9 +21,8 @@ jobs:
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
role-to-assume: ${{ secrets.SECRETS_AWS_PACKAGING_ROLE_TO_ASSUME }}
role-to-assume: arn:aws:iam::206735643321:role/ConfigureAwsCredentialsPackageRole
role-duration-seconds: 900
role-session-name: SecretsManagerFetch
- name: Get bot user token
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
+1 -1
View File
@@ -1,5 +1,5 @@
{
".release-please-manifest.json": "4.0.2",
"package.json": "4.0.2",
".": "4.0.3"
".": "4.2.0"
}
+30
View File
@@ -2,6 +2,36 @@
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.
## [4.2.0](https://github.com/aws-actions/configure-aws-credentials/compare/v4.1.0...v4.2.0) (2025-05-06)
### Features
* add Expiration field to Outputs ([a4f3267](https://github.com/aws-actions/configure-aws-credentials/commit/a4f326760c1c1bf49ab86051c658d6501816b930))
* Document role-duration-seconds range ([5a0cf01](https://github.com/aws-actions/configure-aws-credentials/commit/5a0cf0167f837dfa7af7d951ba6a78a38dc2b79e))
* support action inputs as environment variables ([#1338](https://github.com/aws-actions/configure-aws-credentials/issues/1338)) ([2c168ad](https://github.com/aws-actions/configure-aws-credentials/commit/2c168adcae62d67531ba83842723c8f30695116a))
### Bug Fixes
* make sure action builds, also fix dependabot autoapprove ([c401b8a](https://github.com/aws-actions/configure-aws-credentials/commit/c401b8a98c5067672f52e0387cdd87d54acfe1fd))
* role chaning on mulitple runs ([#1340](https://github.com/aws-actions/configure-aws-credentials/issues/1340)) ([9e38641](https://github.com/aws-actions/configure-aws-credentials/commit/9e386419117a9edd458297e4f1822a5df7506a03))
## [4.1.0](https://github.com/aws-actions/configure-aws-credentials/compare/v4.0.3...v4.1.0) (2025-02-08)
### Features
* idempotent fetch ([#1289](https://github.com/aws-actions/configure-aws-credentials/issues/1289)) ([eb70354](https://github.com/aws-actions/configure-aws-credentials/commit/eb70354fb423a380b6e4ab4b9f15d2ee9ffae911))
### Bug Fixes
* build failure due to tests ([#1283](https://github.com/aws-actions/configure-aws-credentials/issues/1283)) ([134d71e](https://github.com/aws-actions/configure-aws-credentials/commit/134d71efe0ecbe9ad6965f2f766c0cae63a7685f))
* Dependabot autoapprove ([#1284](https://github.com/aws-actions/configure-aws-credentials/issues/1284)) ([b9ee51d](https://github.com/aws-actions/configure-aws-credentials/commit/b9ee51dc600fe38c892e24f60ca26476e0e0b6de))
* Dependabot autoapprove id-token write permission ([#1285](https://github.com/aws-actions/configure-aws-credentials/issues/1285)) ([f0af89b](https://github.com/aws-actions/configure-aws-credentials/commit/f0af89b102390dcf10ce402195d74a98f24861f3))
* typo ([#1281](https://github.com/aws-actions/configure-aws-credentials/issues/1281)) ([39fd91c](https://github.com/aws-actions/configure-aws-credentials/commit/39fd91c08ed8bf770034de4e62662503e8007d76))
## [4.0.3](https://github.com/aws-actions/configure-aws-credentials/compare/v4.0.2...v4.0.3) (2025-01-27)
+23 -16
View File
@@ -105,17 +105,18 @@ See [action.yml](./action.yml) for more detail.
| audience | The JWT audience when using OIDC. Used in non-default AWS partitions, like China regions. | No |
| http-proxy | An HTTP proxy to use for API calls. | No |
| mask-aws-account-id | AWS account IDs are not considered secret. Setting this will hide account IDs from output anyway. | No |
| role-duration-seconds | The assumed role duration in seconds, if assuming a role. Defaults to 1 hour. | No |
| role-duration-seconds | The assumed role duration in seconds, if assuming a role. Defaults to 1 hour (3600 seconds). Acceptable values range from 15 minutes (900 seconds) to 12 hours (43200 seconds). | No |
| role-external-id | The external ID of the role to assume. Only needed if your role requires it. | No |
| role-session-name | Defaults to "GitHubActions", but may be changed if required. | No |
| role-skip-session-tagging | Skips session tagging if set. | No |
| inline-session-policy | You may further restrict the assumed role policy by defining an inline policy here. | No |
| managed-session-policies | You may further restrict the assumed role policy by specifying a managed policy here. | No |
| output-credentials | When set, outputs fetched credentials as action step output. Defaults to false. | No |
| output-credentials | When set, outputs fetched credentials as action step output. (Outputs access-key-id, secret-access-key, session-token, and expiration). Defaults to false. | No |
| unset-current-credentials | When set, attempts to unset any existing credentials in your action runner. | No |
| disable-retry | Disabled retry/backoff logic for assume role calls. By default, retries are enabled. | No |
| retry-max-attempts | Limits the number of retry attempts before giving up. Defaults to 12. | No |
| special-characters-workaround | Uncommonly, some environments cannot tolerate special characters in a secret key. This option will retry fetching credentials until the secret access key does not contain special characters. This option overrides disable-retry and retry-max-attempts. | No |
| use-existing-credentials | When set, the action will check if existing credentials are valid and exit if they are. Defaults to false. | No |
#### Credential Lifetime
The default session duration is **1 hour**.
@@ -130,7 +131,13 @@ with the `role-external-id` input
#### Session tagging and name
The default session name is "GitHubActions", and you can modify it by specifying
the desired name in `role-session-name`. The session will be tagged with the
the desired name in `role-session-name`.
_Note: you might find it helpful to set the `role-session-name` to `${{ github.run_id }}`
so as to clarify in audit logs which AWS actions were performed by which workflow
run._
The session will be tagged with the
following tags: (Refer to [GitHub's documentation for `GITHUB_` environment
variable definitions](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-environment-variables#default-environment-variables))
@@ -183,7 +190,7 @@ line like this:
```
Or we can have a nicely formatted JSON as well:
```yaml
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@v4.1.0
with:
inline-session-policy: >-
{
@@ -204,13 +211,13 @@ The Amazon Resource Names (ARNs) of the IAM managed policies that you want to
use as managed session policies. The policies must exist in the same account as
the role. You can pass a single managed policy like this:
```yaml
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@v4.1.0
with:
managed-session-policies: arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess
```
And we can pass multiple managed policies likes this:
```yaml
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@v4.1.0
with:
managed-session-policies: |
arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess
@@ -285,7 +292,7 @@ You can specify the audience through the `audience` input:
```yaml
- name: Configure AWS Credentials for China region audience
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@v4.1.0
with:
audience: sts.amazonaws.com.cn
aws-region: us-east-3
@@ -420,7 +427,7 @@ You can use this action to simply configure the region and account ID in the
environment, and then use the runner's credentials for all AWS API calls made by
your Actions workflow:
```yaml
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@v4.1.0
with:
aws-region: us-east-2
```
@@ -430,7 +437,7 @@ APIs called by your Actions workflow.
Or, you can use this action to assume a role, and then use the role credentials
for all AWS API calls made by your Actions workflow:
```yaml
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@v4.1.0
with:
aws-region: us-east-2
role-to-assume: my-github-actions-role
@@ -452,7 +459,7 @@ variable.
Manually configured proxy:
```yaml
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@v4.1.0
with:
aws-region: us-east-2
role-to-assume: my-github-actions-role
@@ -479,7 +486,7 @@ should include the AWS CLI by default.
### AssumeRoleWithWebIdentity (recommended)
```yaml
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@v4.1.0
with:
aws-region: us-east-2
role-to-assume: arn:aws:iam::123456789100:role/my-github-actions-role
@@ -493,13 +500,13 @@ environment variable and use it to assume the role
### AssumeRole with role previously assumed by action in same workflow
```yaml
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@v4.1.0
with:
aws-region: us-east-2
role-to-assume: arn:aws:iam::123456789100:role/my-github-actions-role
role-session-name: MySessionName
- name: Configure other AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@v4.1.0
with:
aws-region: us-east-2
role-to-assume: arn:aws:iam::987654321000:role/my-second-role
@@ -514,7 +521,7 @@ role, `arn:aws:iam::987654321000:role/my-second-role`.
### AssumeRole with static IAM credentials in repository secrets
```yaml
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@v4.1.0
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -533,7 +540,7 @@ name, like `role-to-assume: my-github-actions-role`.
```yaml
- name: Configure AWS Credentials 1
id: creds
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@v4.1.0
with:
aws-region: us-east-2
role-to-assume: arn:aws:iam::123456789100:role/my-github-actions-role
@@ -542,7 +549,7 @@ name, like `role-to-assume: my-github-actions-role`.
run: |
aws sts get-caller-identity
- name: Configure AWS Credentials 2
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@v4.1.0
with:
aws-region: us-east-2
aws-access-key-id: ${{ steps.creds.outputs.aws-access-key-id }}
+2
View File
@@ -73,6 +73,8 @@ inputs:
special-characters-workaround:
description: Some environments do not support special characters in AWS_SECRET_ACCESS_KEY. This option will retry fetching credentials until the secret access key does not contain special characters. This option overrides disable-retry and retry-max-attempts. This option is disabled by default
required: false
use-existing-credentials:
description: When enabled, this option will check if there are already valid credentials in the environment. If there are, new credentials will not be fetched. If there are not, the action will run as normal.
outputs:
aws-account-id:
description: The AWS account ID for the provided credentials
Generated Vendored
+5068 -6438
View File
File diff suppressed because it is too large Load Diff
-14
View File
@@ -1,14 +0,0 @@
import { STSClient } from '@aws-sdk/client-sts';
export interface CredentialsClientProps {
region?: string;
proxyServer?: string;
}
export declare class CredentialsClient {
region?: string;
private _stsClient?;
private readonly requestHandler?;
constructor(props: CredentialsClientProps);
get stsClient(): STSClient;
validateCredentials(expectedAccessKeyId?: string, roleChaining?: boolean): Promise<void>;
private loadCredentials;
}
-17
View File
@@ -1,17 +0,0 @@
import type { CredentialsClient } from './CredentialsClient';
export interface assumeRoleParams {
credentialsClient: CredentialsClient;
roleToAssume: string;
roleDuration: number;
roleSessionName: string;
roleSkipSessionTagging?: boolean;
sourceAccountId?: string;
roleExternalId?: string;
webIdentityTokenFile?: string;
webIdentityToken?: string;
inlineSessionPolicy?: string;
managedSessionPolicies?: {
arn: string;
}[];
}
export declare function assumeRole(params: assumeRoleParams): Promise<import("@aws-sdk/client-sts").AssumeRoleCommandOutput>;
-11
View File
@@ -1,11 +0,0 @@
/**
* When the GitHub Actions job is done, clean up any environment variables that
* may have been set by the configure-aws-credentials steps in the job.
*
* Environment variables are not intended to be shared across different jobs in
* the same GitHub Actions workflow: GitHub Actions documentation states that
* each job runs in a fresh instance. However, doing our own cleanup will
* give us additional assurance that these environment variables are not shared
* with any other jobs.
*/
export declare function cleanup(): void;
-16
View File
@@ -1,16 +0,0 @@
import type { Credentials } from '@aws-sdk/client-sts';
import type { CredentialsClient } from './CredentialsClient';
export declare function exportCredentials(creds?: Partial<Credentials>, outputCredentials?: boolean): void;
export declare function unsetCredentials(): void;
export declare function exportRegion(region: string): void;
export declare function exportAccountId(credentialsClient: CredentialsClient, maskAccountId?: boolean): Promise<string>;
export declare function sanitizeGitHubVariables(name: string): string;
export declare function defaultSleep(ms: number): Promise<unknown>;
declare let sleep: typeof defaultSleep;
export declare function withsleep(s: typeof sleep): void;
export declare function reset(): void;
export declare function verifyKeys(creds: Partial<Credentials> | undefined): boolean;
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 {};
-1
View File
@@ -1 +0,0 @@
export declare function run(): Promise<void>;
-1
View File
@@ -1 +0,0 @@
export {};
-1
View File
@@ -1 +0,0 @@
export {};
-1
View File
@@ -1 +0,0 @@
export {};
-74
View File
@@ -1,74 +0,0 @@
import type * as core from '@actions/core';
declare const _default: {
readonly outputs: {
STS_CREDENTIALS: {
Credentials: {
AccessKeyId: string;
SecretAccessKey: string;
SessionToken: string;
Expiration: Date;
};
AssumedRoleUser: {
Arn: string;
AssumedRoleId: string;
};
};
GET_CALLER_IDENTITY: {
Account: string;
Arn: string;
};
FAKE_STS_ACCESS_KEY_ID: string;
FAKE_STS_SECRET_ACCESS_KEY: string;
FAKE_STS_SESSION_TOKEN: string;
ODD_CHARACTER_CREDENTIALS: {
Credentials: {
AccessKeyId: string;
SecretAccessKey: string;
SessionToken: string;
Expiration: Date;
};
AssumedRoleUser: {
Arn: string;
AssumedRoleId: string;
};
};
};
readonly envs: {
GITHUB_REPOSITORY: string;
GITHUB_WORKFLOW: string;
GITHUB_ACTION: string;
GITHUB_ACTOR: string;
GITHUB_SHA: string;
GITHUB_WORKSPACE: string;
GITHUB_ACTIONS: string;
};
readonly GH_OIDC_INPUTS: {
'role-to-assume': string;
'aws-region': string;
'special-characters-workaround': string;
};
readonly IAM_USER_INPUTS: {
'aws-access-key-id': string;
'aws-secret-access-key': string;
'aws-region': string;
};
readonly IAM_ASSUMEROLE_INPUTS: {
'aws-access-key-id': string;
'aws-secret-access-key': string;
'role-to-assume': string;
'aws-region': string;
};
readonly WEBIDENTITY_TOKEN_FILE_INPUTS: {
'web-identity-token-file': string;
'role-to-assume': string;
'aws-region': string;
};
readonly EXISTING_ROLE_INPUTS: {
'role-to-assume': string;
'role-chaining': string;
'aws-region': string;
};
readonly getInput: (fakeEnv: Record<string, string>) => (name: string, options?: core.InputOptions) => string;
readonly getMultilineInput: (fakeEnv: Record<string, string[]>) => (name: string, options?: core.InputOptions) => string[];
};
export default _default;
Generated Vendored
+4495 -7141
View File
File diff suppressed because it is too large Load Diff
+1090 -1119
View File
File diff suppressed because it is too large Load Diff
+11 -11
View File
@@ -1,12 +1,12 @@
{
"name": "configure-aws-credentials",
"description": "A GitHub Action to configure AWS credentials",
"version": "4.0.3",
"version": "4.2.0",
"scripts": {
"build": "tsc --project tsconfig.build.json",
"build": "tsc",
"lint": "biome check --error-on-warnings ./src",
"package": "npm run build && ncc build --license THIRD-PARTY -o dist && ncc build src/cleanup/index.ts -o dist/cleanup && cpy dist/THIRD-PARTY . && del-cli dist/THIRD-PARTY",
"test": "npm run lint && vitest run"
"test": "npm run lint && vitest run && npm run build"
},
"author": {
"name": "Amazon.com, Inc. or its affiliates",
@@ -16,22 +16,22 @@
"devDependencies": {
"@aws-sdk/credential-provider-env": "^3.515.0",
"@biomejs/biome": "1.9.4",
"@smithy/property-provider": "^3.1.7",
"@types/node": "^22.9.0",
"@vercel/ncc": "^0.38.2",
"@vitest/coverage-v8": "^2.1.3",
"@smithy/property-provider": "^4.0.1",
"@types/node": "^22.15.11",
"@vercel/ncc": "^0.38.3",
"@vitest/coverage-v8": "^3.1.2",
"aws-sdk-client-mock": "^4.1.0",
"cpy-cli": "^5.0.0",
"del-cli": "^6.0.0",
"json-schema": "^0.4.0",
"memfs": "^4.14.0",
"memfs": "^4.17.1",
"standard-version": "^9.5.0",
"typescript": "^5.6.3",
"vitest": "^2.1.3"
"typescript": "^5.8.3",
"vitest": "^3.1.2"
},
"dependencies": {
"@actions/core": "^1.11.1",
"@aws-sdk/client-sts": "^3.675.0",
"@aws-sdk/client-sts": "^3.803.0",
"@smithy/node-http-handler": "^4.0.1",
"https-proxy-agent": "^5.0.1"
},
+45
View File
@@ -7,6 +7,35 @@ const MAX_TAG_VALUE_LENGTH = 256;
const SANITIZATION_CHARACTER = '_';
const SPECIAL_CHARS_REGEX = /[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]+/;
export function translateEnvVariables() {
const envVars = [
'AWS_REGION',
'ROLE_TO_ASSUME',
'WEB_IDENTITY_TOKEN_FILE',
'ROLE_CHAINING',
'AUDIENCE',
'HTTP_PROXY',
'MASK_AWS_ACCOUNT_ID',
'ROLE_DURATION_SECONDS',
'ROLE_EXTERNAL_ID',
'ROLE_SESSION_NAME',
'ROLE_SKIP_SESSION_TAGGING',
'INLINE_SESSION_POLICY',
'MANAGED_SESSION_POLICIES',
'OUTPUT_CREDENTIALS',
'UNSET_CURRENT_CREDENTIALS',
'DISABLE_RETRY',
'RETRY_MAX_ATTEMPTS',
'SPECIAL_CHARACTERS_WORKAROUND',
'USE_EXISTING_CREDENTIALS',
];
for (const envVar of envVars) {
if (process.env[envVar]) {
process.env[`INPUT_${envVar.replace(/_/g, '-')}`] = process.env[envVar];
}
}
}
// Configure the AWS CLI and AWS SDKs using environment variables and set them as secrets.
// Setting the credentials as secrets masks them in Github Actions logs
export function exportCredentials(creds?: Partial<Credentials>, outputCredentials?: boolean) {
@@ -38,6 +67,9 @@ export function exportCredentials(creds?: Partial<Credentials>, outputCredential
if (creds?.SessionToken) {
core.setOutput('aws-session-token', creds.SessionToken);
}
if (creds?.Expiration) {
core.setOutput('aws-expiration', creds.Expiration);
}
}
}
@@ -144,3 +176,16 @@ export function isDefined<T>(i: T | undefined | null): i is T {
return i !== undefined && i !== null;
}
/* c8 ignore stop */
export async function areCredentialsValid(credentialsClient: CredentialsClient) {
const client = credentialsClient.stsClient;
try {
const identity = await client.send(new GetCallerIdentityCommand({}));
if (identity.Account) {
return true;
}
return false;
} catch (_) {
return false;
}
}
+15
View File
@@ -3,11 +3,13 @@ import type { AssumeRoleCommandOutput } from '@aws-sdk/client-sts';
import { CredentialsClient } from './CredentialsClient';
import { assumeRole } from './assumeRole';
import {
areCredentialsValid,
errorMessage,
exportAccountId,
exportCredentials,
exportRegion,
retryAndBackoff,
translateEnvVariables,
unsetCredentials,
verifyKeys,
} from './helpers';
@@ -18,6 +20,7 @@ const REGION_REGEX = /^[a-z0-9-]+$/g;
export async function run() {
try {
translateEnvVariables();
// Get inputs
const AccessKeyId = core.getInput('aws-access-key-id', { required: false });
const SecretAccessKey = core.getInput('aws-secret-access-key', {
@@ -60,6 +63,8 @@ export async function run() {
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:
@@ -116,6 +121,16 @@ export async function run() {
let sourceAccountId: string;
let webIdentityToken: string;
//if the user wants to attempt to use existing credentials, check if we have some already
if (useExistingCredentials) {
const validCredentials = await 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()) {
+2 -2
View File
@@ -27,8 +27,8 @@ describe('Configure AWS Credentials helpers', {}, () => {
vi.spyOn(core, 'setOutput').mockImplementation(() => {});
vi.spyOn(core, 'setSecret').mockImplementation(() => {});
vi.spyOn(core, 'exportVariable').mockImplementation(() => {});
helpers.exportCredentials({ AccessKeyId: 'test', SecretAccessKey: 'test', SessionToken: 'test' }, true);
expect(core.setOutput).toHaveBeenCalledTimes(3);
helpers.exportCredentials({ AccessKeyId: 'test', SecretAccessKey: 'test', SessionToken: 'test', Expiration: new Date(8640000000000000) }, true);
expect(core.setOutput).toHaveBeenCalledTimes(4);
expect(core.setSecret).toHaveBeenCalledTimes(3);
expect(core.exportVariable).toHaveBeenCalledTimes(3);
});
+13
View File
@@ -27,6 +27,7 @@ describe('Configure AWS Credentials', {}, () => {
vi.spyOn(core, 'setOutput').mockImplementation((_n, _v) => {});
vi.spyOn(core, 'debug').mockImplementation((_m) => {});
vi.spyOn(core, 'info').mockImplementation((_m) => {});
vi.spyOn(core, 'notice').mockImplementation((_m) => {});
// Remove any existing environment variables before each test to prevent the
// SDK from picking them up
process.env = { ...mocks.envs };
@@ -299,5 +300,17 @@ describe('Configure AWS Credentials', {}, () => {
await run();
expect(core.setFailed).toHaveBeenCalled();
});
it('gets new creds if told to reuse existing but they\'re invalid', {}, async () => {
vi.spyOn(core, 'getInput').mockImplementation(mocks.getInput(mocks.USE_EXISTING_CREDENTIALS_INPUTS));
mockedSTSClient.on(GetCallerIdentityCommand).rejects();
await run();
expect(core.notice).toHaveBeenCalledWith('No valid credentials exist. Running as normal.')
});
it('doesn\'t get new creds if there are already valid ones and we said use them', {}, async () => {
vi.spyOn(core, 'getInput').mockImplementation(mocks.getInput(mocks.USE_EXISTING_CREDENTIALS_INPUTS));
mockedSTSClient.on(GetCallerIdentityCommand).resolves(mocks.outputs.GET_CALLER_IDENTITY);
await run();
expect(core.setFailed).not.toHaveBeenCalled();
})
});
});
+5
View File
@@ -27,6 +27,11 @@ const inputs = {
'role-chaining': 'true',
'aws-region': 'fake-region-1',
},
USE_EXISTING_CREDENTIALS_INPUTS: {
'aws-region': 'fake-region-1',
'use-existing-credentials': 'true',
'role-to-assume': 'arn:aws:iam::111111111111:role/MY-ROLE',
}
};
const envs = {
-9
View File
@@ -1,9 +0,0 @@
{
"extends": "./tsconfig.json",
"exclude": [
"test/**/*.ts"
],
"compilerOptions": {
"rootDir": "src"
},
}
+7 -5
View File
@@ -13,7 +13,7 @@
"module": "CommonJS",
"resolveJsonModule": true,
"outDir": "build",
"declaration": true,
"declaration": false,
"newLine": "lf",
"noEmitOnError": true,
"sourceMap": true,
@@ -22,12 +22,14 @@
"lib": [ "ES2020" ],
"target": "ES2020",
"noErrorTruncation": true,
"esModuleInterop": true
"esModuleInterop": true,
"rootDir": "src",
},
"include": [
"src/**/*.ts",
"test/**/*.test.ts"
"src/**/*.ts"
],
"exclude": [
"test/**/*.ts"
],
"exclude": [],
}
+11
View File
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.json",
"include": [
"test/**/*.ts",
"src/**/*.ts"
],
"exclude": [],
"compilerOptions": {
"rootDir": "./"
},
}
+1
View File
@@ -5,5 +5,6 @@ export default defineConfig({
passWithNoTests: true,
include: ['test/**/*.test.ts'],
coverage: { enabled: true },
typecheck: { tsconfig: './tsconfig.test.json' },
},
});