Compare commits

..

31 Commits

Author SHA1 Message Date
Release Automation 05b148adc3 chore(release): 1.6.1 2022-01-18 18:36:40 +00:00
GitHub Actions 4e8c2213ad chore: Update dist 2022-01-18 18:12:23 +00:00
Parag Sanjay Bhingre 6b3c017dce Merge pull request #350 from paragbhingre/OIDCParallelRequest
fix: OIDC Parallel Requests error
2022-01-18 10:11:36 -08:00
dependabot[bot] 45451d5084 chore: Bump eslint from 8.6.0 to 8.7.0 (#364)
Bumps [eslint](https://github.com/eslint/eslint) from 8.6.0 to 8.7.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.6.0...v8.7.0)

---
updated-dependencies:
- dependency-name: eslint
  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: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-01-18 03:05:10 +00:00
GitHub Actions a27dcef2f6 chore: Update dist 2022-01-18 03:03:14 +00:00
dependabot[bot] 8a29164c8b chore: Bump aws-sdk from 2.1054.0 to 2.1058.0 (#363)
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.1054.0 to 2.1058.0.
- [Release notes](https://github.com/aws/aws-sdk-js/releases)
- [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js/compare/v2.1054.0...v2.1058.0)

---
updated-dependencies:
- dependency-name: aws-sdk
  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>
2022-01-18 03:02:32 +00:00
dependabot[bot] 8d9fac2d2c chore: Bump follow-redirects from 1.14.4 to 1.14.7 (#360)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.4 to 1.14.7.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.4...v1.14.7)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-15 15:44:31 +00:00
GitHub Actions 860d476018 chore: Update dist 2022-01-12 18:39:06 +00:00
dependabot[bot] 98c131dea9 chore: Bump aws-sdk from 2.1049.0 to 2.1054.0 (#353)
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.1049.0 to 2.1054.0.
- [Release notes](https://github.com/aws/aws-sdk-js/releases)
- [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js/compare/v2.1049.0...v2.1054.0)

---
updated-dependencies:
- dependency-name: aws-sdk
  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>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-01-12 18:38:22 +00:00
dependabot[bot] 4d108addaf chore: Bump jest from 27.4.5 to 27.4.7 (#352)
Bumps [jest](https://github.com/facebook/jest) from 27.4.5 to 27.4.7.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/compare/v27.4.5...v27.4.7)

---
updated-dependencies:
- dependency-name: jest
  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: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-01-12 18:36:58 +00:00
Parag Bhingre 133757e9b8 fix: OIDC Parallel Requests error 2022-01-12 10:36:47 -08:00
Parag Sanjay Bhingre 603116e993 Merge pull request #351 from paragbhingre/mergify
fix: Strict Mode Deprecation
2022-01-12 10:34:12 -08:00
Parag Bhingre 4c5e1c60cc fix: Strict Mode Deprecation 2022-01-11 16:42:07 -08:00
dependabot[bot] 9b9980021a chore: Bump eslint from 8.5.0 to 8.6.0 (#347)
Bumps [eslint](https://github.com/eslint/eslint) from 8.5.0 to 8.6.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.5.0...v8.6.0)

---
updated-dependencies:
- dependency-name: eslint
  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: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-01-04 03:04:56 +00:00
GitHub Actions f3ce02b094 chore: Update dist 2022-01-04 03:03:04 +00:00
dependabot[bot] b76c725e12 chore: Bump aws-sdk from 2.1048.0 to 2.1049.0 (#346)
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.1048.0 to 2.1049.0.
- [Release notes](https://github.com/aws/aws-sdk-js/releases)
- [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js/compare/v2.1048.0...v2.1049.0)

---
updated-dependencies:
- dependency-name: aws-sdk
  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>
2022-01-04 03:02:21 +00:00
GitHub Actions 0dbbed9302 chore: Update dist 2021-12-28 03:02:44 +00:00
dependabot[bot] ebbea79d94 chore: Bump aws-sdk from 2.1047.0 to 2.1048.0 (#343)
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.1047.0 to 2.1048.0.
- [Release notes](https://github.com/aws/aws-sdk-js/releases)
- [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js/compare/v2.1047.0...v2.1048.0)

---
updated-dependencies:
- dependency-name: aws-sdk
  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>
2021-12-28 03:02:05 +00:00
dependabot[bot] 7c62b07b9f chore: Bump eslint from 8.4.1 to 8.5.0 (#339)
Bumps [eslint](https://github.com/eslint/eslint) from 8.4.1 to 8.5.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.4.1...v8.5.0)

---
updated-dependencies:
- dependency-name: eslint
  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: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-12-21 03:03:46 +00:00
GitHub Actions 3fbeeb47e5 chore: Update dist 2021-12-21 03:02:11 +00:00
dependabot[bot] 63e6f31c9a chore: Bump aws-sdk from 2.1046.0 to 2.1047.0 (#338)
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.1046.0 to 2.1047.0.
- [Release notes](https://github.com/aws/aws-sdk-js/releases)
- [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js/compare/v2.1046.0...v2.1047.0)

---
updated-dependencies:
- dependency-name: aws-sdk
  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>
2021-12-21 03:01:33 +00:00
GitHub Actions bd9e4620f6 chore: Update dist 2021-12-14 03:03:56 +00:00
dependabot[bot] 57753efe28 chore: Bump aws-sdk from 2.1044.0 to 2.1046.0 (#334)
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.1044.0 to 2.1046.0.
- [Release notes](https://github.com/aws/aws-sdk-js/releases)
- [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js/compare/v2.1044.0...v2.1046.0)

---
updated-dependencies:
- dependency-name: aws-sdk
  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>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-12-14 03:03:18 +00:00
dependabot[bot] 306df94bc9 chore: Bump jest from 27.4.3 to 27.4.5 (#333)
Bumps [jest](https://github.com/facebook/jest) from 27.4.3 to 27.4.5.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/compare/v27.4.3...v27.4.5)

---
updated-dependencies:
- dependency-name: jest
  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>
2021-12-14 03:02:01 +00:00
dependabot[bot] f6ce4d6612 chore: Bump eslint from 8.3.0 to 8.4.1 (#327)
Bumps [eslint](https://github.com/eslint/eslint) from 8.3.0 to 8.4.1.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.3.0...v8.4.1)

---
updated-dependencies:
- dependency-name: eslint
  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: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-12-07 03:05:48 +00:00
GitHub Actions 96a6b113cd chore: Update dist 2021-12-07 03:04:08 +00:00
dependabot[bot] f93938f25d chore: Bump aws-sdk from 2.1039.0 to 2.1044.0 (#328)
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.1039.0 to 2.1044.0.
- [Release notes](https://github.com/aws/aws-sdk-js/releases)
- [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js/compare/v2.1039.0...v2.1044.0)

---
updated-dependencies:
- dependency-name: aws-sdk
  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>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-12-07 03:03:29 +00:00
dependabot[bot] ba85598351 chore: Bump jest from 27.4.0 to 27.4.3 (#326)
Bumps [jest](https://github.com/facebook/jest) from 27.4.0 to 27.4.3.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/compare/v27.4.0...v27.4.3)

---
updated-dependencies:
- dependency-name: jest
  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>
2021-12-07 03:02:16 +00:00
GitHub Actions b978ecdce1 chore: Update dist 2021-11-30 03:03:10 +00:00
dependabot[bot] f60aed899f chore: Bump aws-sdk from 2.1034.0 to 2.1039.0 (#320)
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.1034.0 to 2.1039.0.
- [Release notes](https://github.com/aws/aws-sdk-js/releases)
- [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js/compare/v2.1034.0...v2.1039.0)

---
updated-dependencies:
- dependency-name: aws-sdk
  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>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-11-30 03:02:40 +00:00
dependabot[bot] abe2958c93 chore: Bump jest from 27.3.1 to 27.4.0 (#319)
Bumps [jest](https://github.com/facebook/jest) from 27.3.1 to 27.4.0.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/compare/v27.3.1...v27.4.0)

---
updated-dependencies:
- dependency-name: jest
  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>
2021-11-30 03:01:29 +00:00
7 changed files with 1213 additions and 864 deletions
+11 -6
View File
@@ -1,3 +1,10 @@
queue_rules:
- name: default
conditions:
# Conditions to get out of the queue (= merged)
- status-success=Run Unit Tests
- status-success=Semantic Pull Request
pull_request_rules:
- name: Automatically merge on CI success and review approval
conditions:
@@ -13,10 +20,9 @@ pull_request_rules:
- -closed
- author!=dependabot[bot]
actions:
merge:
queue:
method: squash
strict: smart
strict_method: merge
name: default
- name: Automatically approve and merge Dependabot PRs
conditions:
@@ -31,7 +37,6 @@ pull_request_rules:
actions:
review:
type: APPROVE
merge:
queue:
method: squash
strict: smart+fasttrack
strict_method: merge
name: default
+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.
### [1.6.1](https://github.com/aws-actions/configure-aws-credentials/compare/v1.6.0...v1.6.1) (2022-01-18)
### Bug Fixes
* OIDC Parallel Requests error ([133757e](https://github.com/aws-actions/configure-aws-credentials/commit/133757e9b829f4ef44c8e99e3f272879b45fc9c5))
* Strict Mode Deprecation ([4c5e1c6](https://github.com/aws-actions/configure-aws-credentials/commit/4c5e1c60ccfc95d0e48bf1bc95fc707a94aa2c60))
## [1.6.0](https://github.com/aws-actions/configure-aws-credentials/compare/v1.5.11...v1.6.0) (2021-11-23)
+527 -128
View File
File diff suppressed because one or more lines are too long
+43 -12
View File
@@ -236,6 +236,29 @@ function getStsClient(region) {
});
}
let defaultSleep = function (ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
};
let sleep = defaultSleep;
// retryAndBackoff retries with exponential backoff the promise if the error isRetryable upto maxRetries time.
const retryAndBackoff = async (fn, isRetryable, retries = 0, maxRetries = 12, base = 50) => {
try {
return await fn();
} catch (err) {
if (!isRetryable) {
throw err;
}
// It's retryable, so sleep and retry.
await sleep(Math.random() * (Math.pow(2, retries) * base) );
retries += 1;
if (retries === maxRetries) {
throw err;
}
return await retryAndBackoff(fn, isRetryable, retries, maxRetries, base);
}
}
async function run() {
try {
// Get inputs
@@ -303,17 +326,18 @@ async function run() {
// Get role credentials if configured to do so
if (roleToAssume) {
const roleCredentials = await assumeRole({
sourceAccountId,
region,
roleToAssume,
roleExternalId,
roleDurationSeconds,
roleSessionName,
roleSkipSessionTagging,
webIdentityTokenFile,
webIdentityToken
});
const roleCredentials = await retryAndBackoff(
async () => { return await assumeRole({
sourceAccountId,
region,
roleToAssume,
roleExternalId,
roleDurationSeconds,
roleSessionName,
roleSkipSessionTagging,
webIdentityTokenFile,
webIdentityToken
}) }, true);
exportCredentials(roleCredentials);
// We need to validate the credentials in 2 of our use-cases
// First: self-hosted runners. If the GITHUB_ACTIONS environment variable
@@ -337,7 +361,14 @@ async function run() {
}
}
module.exports = run;
exports.withSleep = function (s) {
sleep = s;
};
exports.reset = function () {
sleep = defaultSleep;
};
exports.run = run
/* istanbul ignore next */
if (require.main === module) {
+23 -1
View File
@@ -1,7 +1,7 @@
const core = require('@actions/core');
const assert = require('assert');
const aws = require('aws-sdk');
const run = require('./index.js');
const { run, withSleep, reset } = require('./index.js');
jest.mock('@actions/core');
@@ -156,10 +156,15 @@ describe('Configure AWS Credentials', () => {
}
}
});
withSleep(() => {
return Promise.resolve();
});
});
afterEach(() => {
process.env = OLD_ENV;
reset();
});
test('exports env vars', async () => {
@@ -612,6 +617,23 @@ describe('Configure AWS Credentials', () => {
expect(core.setSecret).toHaveBeenNthCalledWith(3, FAKE_STS_SESSION_TOKEN);
});
test('role assumption fails after maximun trials using OIDC Provider', async () => {
process.env.GITHUB_ACTIONS = 'true';
process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN = 'test-token';
core.getInput = jest
.fn()
.mockImplementation(mockGetInput({'role-to-assume': ROLE_ARN, 'aws-region': FAKE_REGION}));
mockStsAssumeRoleWithWebIdentity.mockReset();
mockStsAssumeRoleWithWebIdentity.mockImplementation(() => {
throw new Error();
});
await assert.rejects(() => run());
expect(mockStsAssumeRoleWithWebIdentity).toHaveBeenCalledTimes(12)
});
test('role external ID provided', async () => {
core.getInput = jest
.fn()
+597 -713
View File
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "aws-actions-configure-aws-credentials",
"version": "1.6.0",
"version": "1.6.1",
"description": "Configure AWS Credentials",
"main": "index.js",
"scripts": {
@@ -26,12 +26,12 @@
"homepage": "https://github.com/aws-actions/configure-aws-credentials#readme",
"dependencies": {
"@actions/core": "^1.6.0",
"aws-sdk": "^2.1034.0",
"aws-sdk": "^2.1058.0",
"axios": "^0.24.0"
},
"devDependencies": {
"@zeit/ncc": "^0.22.3",
"eslint": "^8.3.0",
"jest": "^27.3.1"
"eslint": "^8.7.0",
"jest": "^27.4.7"
}
}