From 9f25b942f302f6c62628a58ce49d7f95797934bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 22:06:42 +0000 Subject: [PATCH] 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/biome@2.1.2/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] * chore: bump biome and fix linting errors --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: kellertk Co-authored-by: Tom Keller <1083460+kellertk@users.noreply.github.com> --- __mocks__/fs.cjs | 4 +-- biome.jsonc | 18 +++++----- package-lock.json | 73 ++++++++++++++++++++--------------------- package.json | 2 +- src/assumeRole.ts | 1 - src/helpers.ts | 1 - src/index.ts | 2 +- test/cleanup.test.ts | 8 ++--- test/helpers.test.ts | 18 +++++++--- test/index.test.ts | 25 +++++++------- test/mockinputs.test.ts | 4 +-- tsconfig.json | 13 +++----- tsconfig.test.json | 7 ++-- 13 files changed, 86 insertions(+), 90 deletions(-) diff --git a/__mocks__/fs.cjs b/__mocks__/fs.cjs index f9a27d9..3c1dd61 100644 --- a/__mocks__/fs.cjs +++ b/__mocks__/fs.cjs @@ -1,2 +1,2 @@ -const { fs } = require('memfs') -module.exports = fs +const { fs } = require('memfs'); +module.exports = fs; diff --git a/biome.jsonc b/biome.jsonc index ce6c7fb..762d557 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -4,18 +4,18 @@ "lineWidth": 120, "indentWidth": 2, "lineEnding": "lf", - "enabled": true, + "enabled": true }, "linter": { "enabled": true, "rules": { "performance": { - "noDelete": "off", + "noDelete": "off" }, "complexity": { - "noExtraBooleanCast": "off", + "noExtraBooleanCast": "off" } - }, + } }, "javascript": { "formatter": { @@ -23,12 +23,12 @@ "jsxQuoteStyle": "double", "quoteStyle": "single", "bracketSpacing": true, - "arrowParentheses": "always", - }, + "arrowParentheses": "always" + } }, "json": { "formatter": { - "trailingCommas": "all", - }, - }, + "trailingCommas": "none" + } + } } diff --git a/package-lock.json b/package-lock.json index e2b3176..a2e924b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ }, "devDependencies": { "@aws-sdk/credential-provider-env": "^3.858.0", - "@biomejs/biome": "1.9.4", + "@biomejs/biome": "2.1.3", "@smithy/property-provider": "^4.0.3", "@types/node": "^24.0.3", "@vercel/ncc": "^0.38.3", @@ -781,11 +781,10 @@ } }, "node_modules/@biomejs/biome": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.9.4.tgz", - "integrity": "sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.1.3.tgz", + "integrity": "sha512-KE/tegvJIxTkl7gJbGWSgun7G6X/n2M6C35COT6ctYrAy7SiPyNvi6JtoQERVK/VRbttZfgGq96j2bFmhmnH4w==", "dev": true, - "hasInstallScript": true, "license": "MIT OR Apache-2.0", "bin": { "biome": "bin/biome" @@ -798,20 +797,20 @@ "url": "https://opencollective.com/biome" }, "optionalDependencies": { - "@biomejs/cli-darwin-arm64": "1.9.4", - "@biomejs/cli-darwin-x64": "1.9.4", - "@biomejs/cli-linux-arm64": "1.9.4", - "@biomejs/cli-linux-arm64-musl": "1.9.4", - "@biomejs/cli-linux-x64": "1.9.4", - "@biomejs/cli-linux-x64-musl": "1.9.4", - "@biomejs/cli-win32-arm64": "1.9.4", - "@biomejs/cli-win32-x64": "1.9.4" + "@biomejs/cli-darwin-arm64": "2.1.3", + "@biomejs/cli-darwin-x64": "2.1.3", + "@biomejs/cli-linux-arm64": "2.1.3", + "@biomejs/cli-linux-arm64-musl": "2.1.3", + "@biomejs/cli-linux-x64": "2.1.3", + "@biomejs/cli-linux-x64-musl": "2.1.3", + "@biomejs/cli-win32-arm64": "2.1.3", + "@biomejs/cli-win32-x64": "2.1.3" } }, "node_modules/@biomejs/cli-darwin-arm64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.9.4.tgz", - "integrity": "sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.1.3.tgz", + "integrity": "sha512-LFLkSWRoSGS1wVUD/BE6Nlt2dSn0ulH3XImzg2O/36BoToJHKXjSxzPEMAqT9QvwVtk7/9AQhZpTneERU9qaXA==", "cpu": [ "arm64" ], @@ -826,9 +825,9 @@ } }, "node_modules/@biomejs/cli-darwin-x64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.9.4.tgz", - "integrity": "sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.1.3.tgz", + "integrity": "sha512-Q/4OTw8P9No9QeowyxswcWdm0n2MsdCwWcc5NcKQQvzwPjwuPdf8dpPPf4r+x0RWKBtl1FLiAUtJvBlri6DnYw==", "cpu": [ "x64" ], @@ -843,9 +842,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.9.4.tgz", - "integrity": "sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.1.3.tgz", + "integrity": "sha512-2hS6LgylRqMFmAZCOFwYrf77QMdUwJp49oe8PX/O8+P2yKZMSpyQTf3Eo5ewnsMFUEmYbPOskafdV1ds1MZMJA==", "cpu": [ "arm64" ], @@ -860,9 +859,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64-musl": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.9.4.tgz", - "integrity": "sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.1.3.tgz", + "integrity": "sha512-KXouFSBnoxAWZYDQrnNRzZBbt5s9UJkIm40hdvSL9mBxSSoxRFQJbtg1hP3aa8A2SnXyQHxQfpiVeJlczZt76w==", "cpu": [ "arm64" ], @@ -877,9 +876,9 @@ } }, "node_modules/@biomejs/cli-linux-x64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.9.4.tgz", - "integrity": "sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.1.3.tgz", + "integrity": "sha512-NxlSCBhLvQtWGagEztfAZ4WcE1AkMTntZV65ZvR+J9jp06+EtOYEBPQndA70ZGhHbEDG57bR6uNvqkd1WrEYVA==", "cpu": [ "x64" ], @@ -894,9 +893,9 @@ } }, "node_modules/@biomejs/cli-linux-x64-musl": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.9.4.tgz", - "integrity": "sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.1.3.tgz", + "integrity": "sha512-KaLAxnROouzIWtl6a0Y88r/4hW5oDUJTIqQorOTVQITaKQsKjZX4XCUmHIhdEk8zMnaiLZzRTAwk1yIAl+mIew==", "cpu": [ "x64" ], @@ -911,9 +910,9 @@ } }, "node_modules/@biomejs/cli-win32-arm64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.9.4.tgz", - "integrity": "sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.1.3.tgz", + "integrity": "sha512-V9CUZCtWH4u0YwyCYbQ3W5F4ZGPWp2C2TYcsiWFNNyRfmOW1j/TY/jAurl33SaRjgZPO5UUhGyr9m6BN9t84NQ==", "cpu": [ "arm64" ], @@ -928,9 +927,9 @@ } }, "node_modules/@biomejs/cli-win32-x64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.9.4.tgz", - "integrity": "sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.1.3.tgz", + "integrity": "sha512-dxy599q6lgp8ANPpR8sDMscwdp9oOumEsVXuVCVT9N2vAho8uYXlCz53JhxX6LtJOXaE73qzgkGQ7QqvFlMC0g==", "cpu": [ "x64" ], diff --git a/package.json b/package.json index 79a06a5..7f57e7c 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ }, "devDependencies": { "@aws-sdk/credential-provider-env": "^3.858.0", - "@biomejs/biome": "1.9.4", + "@biomejs/biome": "2.1.3", "@smithy/property-provider": "^4.0.3", "@types/node": "^24.0.3", "@vercel/ncc": "^0.38.3", diff --git a/src/assumeRole.ts b/src/assumeRole.ts index 62db820..8cbc508 100644 --- a/src/assumeRole.ts +++ b/src/assumeRole.ts @@ -147,7 +147,6 @@ export async function assumeRole(params: assumeRoleParams) { PolicyArns: managedSessionPolicies?.length ? managedSessionPolicies : undefined, }; const keys = Object.keys(commonAssumeRoleParams) as Array; - // biome-ignore lint/complexity/noForEach: Legacy code keys.forEach((k) => commonAssumeRoleParams[k] === undefined && delete commonAssumeRoleParams[k]); // Instantiate STS client diff --git a/src/helpers.ts b/src/helpers.ts index 1c179d7..2adf054 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -178,7 +178,6 @@ export async function retryAndBackoff( } // It's retryable, so sleep and retry. await sleep(Math.random() * (2 ** retries * base)); - // biome-ignore lint/style/noParameterAssign: This is a loop variable retries += 1; if (retries >= maxRetries) { throw err; diff --git a/src/index.ts b/src/index.ts index e52fcdf..dd75434 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ import * as core from '@actions/core'; import type { AssumeRoleCommandOutput } from '@aws-sdk/client-sts'; -import { CredentialsClient } from './CredentialsClient'; import { assumeRole } from './assumeRole'; +import { CredentialsClient } from './CredentialsClient'; import { areCredentialsValid, errorMessage, diff --git a/test/cleanup.test.ts b/test/cleanup.test.ts index 29c19ec..02b2468 100644 --- a/test/cleanup.test.ts +++ b/test/cleanup.test.ts @@ -1,8 +1,8 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; -import { cleanup } from '../src/cleanup'; import * as core from '@actions/core'; -import { mockClient } from 'aws-sdk-client-mock'; import { STSClient } from '@aws-sdk/client-sts'; +import { mockClient } from 'aws-sdk-client-mock'; +import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { cleanup } from '../src/cleanup'; import mocks from './mockinputs.test'; const mockedSTSClient = mockClient(STSClient); @@ -49,5 +49,5 @@ describe('Configure AWS Credentials cleanup', {}, () => { vi.spyOn(core, 'getInput').mockImplementation(mocks.getInput(mocks.NO_ENV_CREDS_INPUTS)); cleanup(); expect(core.exportVariable).toHaveBeenCalledTimes(0); - }) + }); }); diff --git a/test/helpers.test.ts b/test/helpers.test.ts index 0906acf..b2c23de 100644 --- a/test/helpers.test.ts +++ b/test/helpers.test.ts @@ -1,7 +1,7 @@ -import { describe, it, expect, vi } from 'vitest'; -import * as helpers from '../src/helpers'; +import { beforeEach } from 'node:test'; import * as core from '@actions/core'; -import { before, beforeEach } from 'node:test'; +import { describe, expect, it, vi } from 'vitest'; +import * as helpers from '../src/helpers'; describe('Configure AWS Credentials helpers', {}, () => { beforeEach(() => { @@ -27,7 +27,11 @@ 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', Expiration: new Date(8640000000000000) }, true, true); + helpers.exportCredentials( + { AccessKeyId: 'test', SecretAccessKey: 'test', SessionToken: 'test', Expiration: new Date(8640000000000000) }, + true, + true, + ); expect(core.setOutput).toHaveBeenCalledTimes(4); expect(core.setSecret).toHaveBeenCalledTimes(3); expect(core.exportVariable).toHaveBeenCalledTimes(3); @@ -46,7 +50,11 @@ 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', Expiration: new Date(8640000000000000) }, true, false); + helpers.exportCredentials( + { AccessKeyId: 'test', SecretAccessKey: 'test', SessionToken: 'test', Expiration: new Date(8640000000000000) }, + true, + false, + ); helpers.unsetCredentials(false); helpers.exportRegion('fake-test-region', false); expect(core.setOutput).toHaveBeenCalledTimes(4); diff --git a/test/index.test.ts b/test/index.test.ts index ca4e0b1..fcdd784 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -1,17 +1,16 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import * as core from '@actions/core'; import { AssumeRoleCommand, AssumeRoleWithWebIdentityCommand, GetCallerIdentityCommand, STSClient, } from '@aws-sdk/client-sts'; -import { fs, vol } from 'memfs'; -import * as core from '@actions/core'; -import mocks from './mockinputs.test'; import { mockClient } from 'aws-sdk-client-mock'; -import { run } from '../src/index'; +import { fs, vol } from 'memfs'; +import { beforeEach, describe, expect, it, vi } from 'vitest'; import { CredentialsClient } from '../src/CredentialsClient'; -import { before } from 'node:test'; +import { run } from '../src/index'; +import mocks from './mockinputs.test'; const mockedSTSClient = mockClient(STSClient); @@ -300,19 +299,19 @@ describe('Configure AWS Credentials', {}, () => { await run(); expect(core.setFailed).toHaveBeenCalled(); }); - it('gets new creds if told to reuse existing but they\'re invalid', {}, async () => { + 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.') + 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 () => { + 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(); - }) - it('doesn\'t export credentials as environment variables if told not to', {}, async () => { + }); + it("doesn't export credentials as environment variables if told not to", {}, async () => { mockedSTSClient.on(AssumeRoleWithWebIdentityCommand).resolvesOnce(mocks.outputs.STS_CREDENTIALS); vi.spyOn(core, 'getInput').mockImplementation(mocks.getInput(mocks.NO_ENV_CREDS_INPUTS)); vi.spyOn(core, 'getIDToken').mockResolvedValue('testoidctoken'); @@ -321,7 +320,7 @@ describe('Configure AWS Credentials', {}, () => { expect(core.setSecret).toHaveBeenCalledTimes(3); expect(core.exportVariable).toHaveBeenCalledTimes(0); expect(core.setFailed).not.toHaveBeenCalled(); - }) + }); it('can export creds as step outputs without exporting as env variables', {}, async () => { mockedSTSClient.on(AssumeRoleWithWebIdentityCommand).resolvesOnce(mocks.outputs.STS_CREDENTIALS); vi.spyOn(core, 'getInput').mockImplementation(mocks.getInput(mocks.STEP_BUT_NO_ENV_INPUTS)); @@ -332,6 +331,6 @@ describe('Configure AWS Credentials', {}, () => { expect(core.exportVariable).toHaveBeenCalledTimes(0); expect(core.setOutput).toHaveBeenCalledTimes(4); expect(core.setFailed).not.toHaveBeenCalled(); - }) + }); }); }); diff --git a/test/mockinputs.test.ts b/test/mockinputs.test.ts index 7fe72da..1caa1fe 100644 --- a/test/mockinputs.test.ts +++ b/test/mockinputs.test.ts @@ -35,14 +35,14 @@ const inputs = { NO_ENV_CREDS_INPUTS: { 'role-to-assume': 'arn:aws:iam::111111111111:role/MY-ROLE', 'aws-region': 'fake-region-1', - 'output-env-credentials': 'false' + 'output-env-credentials': 'false', }, STEP_BUT_NO_ENV_INPUTS: { 'role-to-assume': 'arn:aws:iam::111111111111:role/MY-ROLE', 'aws-region': 'fake-region-1', 'output-env-credentials': 'false', 'output-credentials': 'true', - } + }, }; const envs = { diff --git a/tsconfig.json b/tsconfig.json index aa2ba03..227fd81 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,17 +19,12 @@ "sourceMap": true, "disableSizeLimit": true, "forceConsistentCasingInFileNames": true, - "lib": [ "ES2020" ], + "lib": ["ES2020"], "target": "ES2020", "noErrorTruncation": true, "esModuleInterop": true, - "rootDir": "src", + "rootDir": "src" }, - "include": [ - "src/**/*.ts" - ], - "exclude": [ - "test/**/*.ts" - ], + "include": ["src/**/*.ts"], + "exclude": ["test/**/*.ts"] } - diff --git a/tsconfig.test.json b/tsconfig.test.json index fe3a1ff..003cfc7 100644 --- a/tsconfig.test.json +++ b/tsconfig.test.json @@ -1,11 +1,8 @@ { "extends": "./tsconfig.json", - "include": [ - "test/**/*.ts", - "src/**/*.ts" - ], + "include": ["test/**/*.ts", "src/**/*.ts"], "exclude": [], "compilerOptions": { "rootDir": "./" - }, + } }