Skip to content

Commit

Permalink
Introduce some log
Browse files Browse the repository at this point in the history
- insights absolutely missing...
- actions fails sporadically with a
  "message not found" error
- currently watching aws-actions#395
- also fix a bug in the unit test
  (guess it was changed but not executed
  some time...)

KNUTH-66633
  • Loading branch information
mmuth authored and foxylion committed Jun 20, 2023
1 parent df04187 commit c3b6db9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49319,6 +49319,7 @@ const ROLE_SESSION_NAME = 'GitHubActions';
const REGION_REGEX = /^[a-z0-9-]+$/g;

async function assumeRole(params) {
core.info("Assuming Role...");
// Assume a role to get short-lived credentials using longer-lived credentials.
const isDefined = i => !!i;

Expand Down Expand Up @@ -49630,6 +49631,8 @@ async function run() {
throw new Error(`Region is not valid: ${region}`);
}

core.info("Configuring AWS credentials...");

exportRegion(region);

// This wraps the logic for deciding if we should rely on the GH OIDC provider since we may need to reference
Expand Down Expand Up @@ -49707,6 +49710,8 @@ async function run() {
}
}
catch (error) {
core.error("Global error occured when configuring credentials");
core.error(error);
core.setFailed(error.message);

const showStackTrace = process.env.SHOW_STACK_TRACE;
Expand Down
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const ROLE_SESSION_NAME = 'GitHubActions';
const REGION_REGEX = /^[a-z0-9-]+$/g;

async function assumeRole(params) {
core.info("Assuming Role...");
// Assume a role to get short-lived credentials using longer-lived credentials.
const isDefined = i => !!i;

Expand Down Expand Up @@ -328,6 +329,8 @@ async function run() {
throw new Error(`Region is not valid: ${region}`);
}

core.info("Configuring AWS credentials...");

exportRegion(region);

// This wraps the logic for deciding if we should rely on the GH OIDC provider since we may need to reference
Expand Down Expand Up @@ -405,6 +408,8 @@ async function run() {
}
}
catch (error) {
core.error("Global error occured when configuring credentials");
core.error(error);
core.setFailed(error.message);

const showStackTrace = process.env.SHOW_STACK_TRACE;
Expand Down
2 changes: 1 addition & 1 deletion index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ describe('Configure AWS Credentials', () => {
});

await assert.rejects(() => run());
expect(mockStsAssumeRoleWithWebIdentity).toHaveBeenCalledTimes(12)
expect(mockStsAssumeRoleWithWebIdentity).toHaveBeenCalledTimes(20)
});

test('role external ID provided', async () => {
Expand Down

0 comments on commit c3b6db9

Please sign in to comment.