Skip to content

Commit e7ec4b6

Browse files
chore(deps-dev): bump @biomejs/biome from 1.9.4 to 2.1.2 (#1410)
* chore(deps-dev): bump @biomejs/biome from 1.9.4 to 2.1.2 Bumps [@biomejs/biome](https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome) from 1.9.4 to 2.1.2. - [Release notes](https://github.com/biomejs/biome/releases) - [Changelog](https://github.com/biomejs/biome/blob/main/packages/@biomejs/biome/CHANGELOG.md) - [Commits](https://github.com/biomejs/biome/commits/@biomejs/[email protected]/packages/@biomejs/biome) --- updated-dependencies: - dependency-name: "@biomejs/biome" dependency-version: 2.1.2 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * chore: bump biome and fix linting errors --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: kellertk <[email protected]> Co-authored-by: Tom Keller <[email protected]>
1 parent 5b3c895 commit e7ec4b6

13 files changed

+86
-90
lines changed

__mocks__/fs.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
const { fs } = require('memfs')
2-
module.exports = fs
1+
const { fs } = require('memfs');
2+
module.exports = fs;

biome.jsonc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,31 @@
44
"lineWidth": 120,
55
"indentWidth": 2,
66
"lineEnding": "lf",
7-
"enabled": true,
7+
"enabled": true
88
},
99
"linter": {
1010
"enabled": true,
1111
"rules": {
1212
"performance": {
13-
"noDelete": "off",
13+
"noDelete": "off"
1414
},
1515
"complexity": {
16-
"noExtraBooleanCast": "off",
16+
"noExtraBooleanCast": "off"
1717
}
18-
},
18+
}
1919
},
2020
"javascript": {
2121
"formatter": {
2222
"trailingCommas": "all",
2323
"jsxQuoteStyle": "double",
2424
"quoteStyle": "single",
2525
"bracketSpacing": true,
26-
"arrowParentheses": "always",
27-
},
26+
"arrowParentheses": "always"
27+
}
2828
},
2929
"json": {
3030
"formatter": {
31-
"trailingCommas": "all",
32-
},
33-
},
31+
"trailingCommas": "none"
32+
}
33+
}
3434
}

package-lock.json

Lines changed: 36 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"devDependencies": {
1717
"@aws-sdk/credential-provider-env": "^3.858.0",
18-
"@biomejs/biome": "1.9.4",
18+
"@biomejs/biome": "2.1.3",
1919
"@smithy/property-provider": "^4.0.3",
2020
"@types/node": "^24.0.3",
2121
"@vercel/ncc": "^0.38.3",

src/assumeRole.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ export async function assumeRole(params: assumeRoleParams) {
142142
PolicyArns: managedSessionPolicies?.length ? managedSessionPolicies : undefined,
143143
};
144144
const keys = Object.keys(commonAssumeRoleParams) as Array<keyof typeof commonAssumeRoleParams>;
145-
// biome-ignore lint/complexity/noForEach: Legacy code
146145
keys.forEach((k) => commonAssumeRoleParams[k] === undefined && delete commonAssumeRoleParams[k]);
147146

148147
// Instantiate STS client

src/helpers.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ export async function retryAndBackoff<T>(
178178
}
179179
// It's retryable, so sleep and retry.
180180
await sleep(Math.random() * (2 ** retries * base));
181-
// biome-ignore lint/style/noParameterAssign: This is a loop variable
182181
retries += 1;
183182
if (retries >= maxRetries) {
184183
throw err;

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as core from '@actions/core';
22
import type { AssumeRoleCommandOutput } from '@aws-sdk/client-sts';
3-
import { CredentialsClient } from './CredentialsClient';
43
import { assumeRole } from './assumeRole';
4+
import { CredentialsClient } from './CredentialsClient';
55
import {
66
areCredentialsValid,
77
errorMessage,

test/cleanup.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
2-
import { cleanup } from '../src/cleanup';
31
import * as core from '@actions/core';
4-
import { mockClient } from 'aws-sdk-client-mock';
52
import { STSClient } from '@aws-sdk/client-sts';
3+
import { mockClient } from 'aws-sdk-client-mock';
4+
import { beforeEach, describe, expect, it, vi } from 'vitest';
5+
import { cleanup } from '../src/cleanup';
66
import mocks from './mockinputs.test';
77

88
const mockedSTSClient = mockClient(STSClient);
@@ -49,5 +49,5 @@ describe('Configure AWS Credentials cleanup', {}, () => {
4949
vi.spyOn(core, 'getInput').mockImplementation(mocks.getInput(mocks.NO_ENV_CREDS_INPUTS));
5050
cleanup();
5151
expect(core.exportVariable).toHaveBeenCalledTimes(0);
52-
})
52+
});
5353
});

test/helpers.test.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { describe, it, expect, vi } from 'vitest';
2-
import * as helpers from '../src/helpers';
1+
import { beforeEach } from 'node:test';
32
import * as core from '@actions/core';
4-
import { before, beforeEach } from 'node:test';
3+
import { describe, expect, it, vi } from 'vitest';
4+
import * as helpers from '../src/helpers';
55

66
describe('Configure AWS Credentials helpers', {}, () => {
77
beforeEach(() => {
@@ -27,7 +27,11 @@ describe('Configure AWS Credentials helpers', {}, () => {
2727
vi.spyOn(core, 'setOutput').mockImplementation(() => {});
2828
vi.spyOn(core, 'setSecret').mockImplementation(() => {});
2929
vi.spyOn(core, 'exportVariable').mockImplementation(() => {});
30-
helpers.exportCredentials({ AccessKeyId: 'test', SecretAccessKey: 'test', SessionToken: 'test', Expiration: new Date(8640000000000000) }, true, true);
30+
helpers.exportCredentials(
31+
{ AccessKeyId: 'test', SecretAccessKey: 'test', SessionToken: 'test', Expiration: new Date(8640000000000000) },
32+
true,
33+
true,
34+
);
3135
expect(core.setOutput).toHaveBeenCalledTimes(4);
3236
expect(core.setSecret).toHaveBeenCalledTimes(3);
3337
expect(core.exportVariable).toHaveBeenCalledTimes(3);
@@ -46,7 +50,11 @@ describe('Configure AWS Credentials helpers', {}, () => {
4650
vi.spyOn(core, 'setOutput').mockImplementation(() => {});
4751
vi.spyOn(core, 'setSecret').mockImplementation(() => {});
4852
vi.spyOn(core, 'exportVariable').mockImplementation(() => {});
49-
helpers.exportCredentials({ AccessKeyId: 'test', SecretAccessKey: 'test', SessionToken: 'test', Expiration: new Date(8640000000000000) }, true, false);
53+
helpers.exportCredentials(
54+
{ AccessKeyId: 'test', SecretAccessKey: 'test', SessionToken: 'test', Expiration: new Date(8640000000000000) },
55+
true,
56+
false,
57+
);
5058
helpers.unsetCredentials(false);
5159
helpers.exportRegion('fake-test-region', false);
5260
expect(core.setOutput).toHaveBeenCalledTimes(4);

test/index.test.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
1+
import * as core from '@actions/core';
22
import {
33
AssumeRoleCommand,
44
AssumeRoleWithWebIdentityCommand,
55
GetCallerIdentityCommand,
66
STSClient,
77
} from '@aws-sdk/client-sts';
8-
import { fs, vol } from 'memfs';
9-
import * as core from '@actions/core';
10-
import mocks from './mockinputs.test';
118
import { mockClient } from 'aws-sdk-client-mock';
12-
import { run } from '../src/index';
9+
import { fs, vol } from 'memfs';
10+
import { beforeEach, describe, expect, it, vi } from 'vitest';
1311
import { CredentialsClient } from '../src/CredentialsClient';
14-
import { before } from 'node:test';
12+
import { run } from '../src/index';
13+
import mocks from './mockinputs.test';
1514

1615
const mockedSTSClient = mockClient(STSClient);
1716

@@ -300,19 +299,19 @@ describe('Configure AWS Credentials', {}, () => {
300299
await run();
301300
expect(core.setFailed).toHaveBeenCalled();
302301
});
303-
it('gets new creds if told to reuse existing but they\'re invalid', {}, async () => {
302+
it("gets new creds if told to reuse existing but they're invalid", {}, async () => {
304303
vi.spyOn(core, 'getInput').mockImplementation(mocks.getInput(mocks.USE_EXISTING_CREDENTIALS_INPUTS));
305304
mockedSTSClient.on(GetCallerIdentityCommand).rejects();
306305
await run();
307-
expect(core.notice).toHaveBeenCalledWith('No valid credentials exist. Running as normal.')
306+
expect(core.notice).toHaveBeenCalledWith('No valid credentials exist. Running as normal.');
308307
});
309-
it('doesn\'t get new creds if there are already valid ones and we said use them', {}, async () => {
308+
it("doesn't get new creds if there are already valid ones and we said use them", {}, async () => {
310309
vi.spyOn(core, 'getInput').mockImplementation(mocks.getInput(mocks.USE_EXISTING_CREDENTIALS_INPUTS));
311310
mockedSTSClient.on(GetCallerIdentityCommand).resolves(mocks.outputs.GET_CALLER_IDENTITY);
312311
await run();
313312
expect(core.setFailed).not.toHaveBeenCalled();
314-
})
315-
it('doesn\'t export credentials as environment variables if told not to', {}, async () => {
313+
});
314+
it("doesn't export credentials as environment variables if told not to", {}, async () => {
316315
mockedSTSClient.on(AssumeRoleWithWebIdentityCommand).resolvesOnce(mocks.outputs.STS_CREDENTIALS);
317316
vi.spyOn(core, 'getInput').mockImplementation(mocks.getInput(mocks.NO_ENV_CREDS_INPUTS));
318317
vi.spyOn(core, 'getIDToken').mockResolvedValue('testoidctoken');
@@ -321,7 +320,7 @@ describe('Configure AWS Credentials', {}, () => {
321320
expect(core.setSecret).toHaveBeenCalledTimes(3);
322321
expect(core.exportVariable).toHaveBeenCalledTimes(0);
323322
expect(core.setFailed).not.toHaveBeenCalled();
324-
})
323+
});
325324
it('can export creds as step outputs without exporting as env variables', {}, async () => {
326325
mockedSTSClient.on(AssumeRoleWithWebIdentityCommand).resolvesOnce(mocks.outputs.STS_CREDENTIALS);
327326
vi.spyOn(core, 'getInput').mockImplementation(mocks.getInput(mocks.STEP_BUT_NO_ENV_INPUTS));
@@ -332,6 +331,6 @@ describe('Configure AWS Credentials', {}, () => {
332331
expect(core.exportVariable).toHaveBeenCalledTimes(0);
333332
expect(core.setOutput).toHaveBeenCalledTimes(4);
334333
expect(core.setFailed).not.toHaveBeenCalled();
335-
})
334+
});
336335
});
337336
});

0 commit comments

Comments
 (0)