From e13a6573a54bfb40a5b56079d7fcd4a462a46f3a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 21:39:29 +0000 Subject: [PATCH 1/3] chore(deps): bump github/codeql-action in the dependencies group Bumps the dependencies group with 1 update: [github/codeql-action](https://github.com/github/codeql-action). Updates `github/codeql-action` from 3.27.5 to 3.27.6 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/f09c1c0a94de965c15400f5634aa42fac8fb8f88...aa578102511db1f4524ed59b8cc2bae4f6e88195) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies ... Signed-off-by: dependabot[bot] --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index c5095b6..4c0fe90 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -42,6 +42,6 @@ jobs: path: results.sarif retention-days: 5 - name: 'Upload to code-scanning' - uses: github/codeql-action/upload-sarif@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 + uses: github/codeql-action/upload-sarif@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 with: sarif_file: results.sarif From 29cdebb0b2f8ac22b6e952179167da621cdd8a55 Mon Sep 17 00:00:00 2001 From: Riley Kohler Date: Mon, 16 Dec 2024 11:10:17 -0500 Subject: [PATCH 2/3] fix: resolve inconsistent eslint issues --- src/app/api/auth/lib/nextauth-options.ts | 2 +- src/bot/index.ts | 2 +- src/types/forks.ts | 4 ++-- src/utils/logger.ts | 10 +++++----- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/app/api/auth/lib/nextauth-options.ts b/src/app/api/auth/lib/nextauth-options.ts index acb5396..a9da74d 100644 --- a/src/app/api/auth/lib/nextauth-options.ts +++ b/src/app/api/auth/lib/nextauth-options.ts @@ -29,7 +29,7 @@ export const verifySession = async (token: string | undefined) => { try { await octokit.rest.users.getAuthenticated() return true - } catch (error) { + } catch { return false } } diff --git a/src/bot/index.ts b/src/bot/index.ts index 4c7a84f..eeedbd2 100644 --- a/src/bot/index.ts +++ b/src/bot/index.ts @@ -29,7 +29,7 @@ export const getMetadata = ( try { return JSON.parse(description) as Record - } catch (error) { + } catch { botLogger.warn('Failed to parse repository description', { description }) return {} } diff --git a/src/types/forks.ts b/src/types/forks.ts index 7a37090..f322812 100644 --- a/src/types/forks.ts +++ b/src/types/forks.ts @@ -2,7 +2,7 @@ import { z } from 'zod' // this type is generated from the graphql query to support // the requirements of the primer datatable component -const forksObject = z.object({ +const ForksObject = z.object({ organization: z.object({ repositories: z.object({ totalCount: z.number(), @@ -40,4 +40,4 @@ const forksObject = z.object({ }), }) -export type ForksObject = z.infer +export type ForksObject = z.infer diff --git a/src/utils/logger.ts b/src/utils/logger.ts index 0b655d3..b24a61f 100644 --- a/src/utils/logger.ts +++ b/src/utils/logger.ts @@ -7,7 +7,7 @@ import { Logger } from 'tslog' const stringify = (obj: any) => { try { return JSON.stringify(obj) - } catch (e) { + } catch { return safeStringify(obj) } } @@ -26,7 +26,7 @@ const getLoggerType = () => { } // Map logger level name to number for tsLog -const mapLevelToMethod: { [key: string]: number } = { +const mapLevelToMethod: Record = { silly: 0, trace: 1, debug: 2, @@ -39,7 +39,7 @@ const mapLevelToMethod: { [key: string]: number } = { export const logger = new Logger({ type: getLoggerType(), minLevel: - mapLevelToMethod[process.env.LOGGING_LEVEL?.toLowerCase() || 'info'], + mapLevelToMethod[process.env.LOGGING_LEVEL?.toLowerCase() ?? 'info'], maskValuesRegEx: [ /"access[-._]?token":"[^"]+"/g, /"api[-._]?key":"[^"]+"/g, @@ -70,7 +70,7 @@ export const logger = new Logger({ // set message if it's a string or set it as info if ( - Object.prototype.hasOwnProperty.call(logObjWithMeta, '0') && + Object.hasOwn(logObjWithMeta, '0') && typeof logObjWithMeta['0'] === 'string' ) { output.message = logObjWithMeta['0'] @@ -79,7 +79,7 @@ export const logger = new Logger({ } // set data - if (Object.prototype.hasOwnProperty.call(logObjWithMeta, '1')) { + if (Object.hasOwn(logObjWithMeta, '1')) { output.data = logObjWithMeta['1'] } From 85c654f487873e04acc770830407abf0ece70112 Mon Sep 17 00:00:00 2001 From: Riley Kohler Date: Mon, 16 Dec 2024 11:21:08 -0500 Subject: [PATCH 3/3] chore: gitignore generated next-env types --- .gitignore | 1 + next-env.d.ts | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 next-env.d.ts diff --git a/.gitignore b/.gitignore index 4f47a71..4560070 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ build .env.* !.env.example .DS_Store +next-env.d.ts diff --git a/next-env.d.ts b/next-env.d.ts deleted file mode 100644 index fd36f94..0000000 --- a/next-env.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/// -/// -/// - -// NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information.