Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/dependencies-b4bcd00e41
Browse files Browse the repository at this point in the history
  • Loading branch information
ahpook authored Dec 16, 2024
2 parents baf5e9e + de4b29d commit c0624eb
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ build
.env.*
!.env.example
.DS_Store
next-env.d.ts
6 changes: 0 additions & 6 deletions next-env.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/app/api/auth/lib/nextauth-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const verifySession = async (token: string | undefined) => {
try {
await octokit.rest.users.getAuthenticated()
return true
} catch (error) {
} catch {
return false
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/bot/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const getMetadata = (

try {
return JSON.parse(description) as Record<string, string>
} catch (error) {
} catch {
botLogger.warn('Failed to parse repository description', { description })
return {}
}
Expand Down
4 changes: 2 additions & 2 deletions src/types/forks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -40,4 +40,4 @@ const forksObject = z.object({
}),
})

export type ForksObject = z.infer<typeof forksObject>
export type ForksObject = z.infer<typeof ForksObject>
10 changes: 5 additions & 5 deletions src/utils/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Logger } from 'tslog'
const stringify = (obj: any) => {
try {
return JSON.stringify(obj)
} catch (e) {
} catch {
return safeStringify(obj)
}
}
Expand All @@ -26,7 +26,7 @@ const getLoggerType = () => {
}

// Map logger level name to number for tsLog
const mapLevelToMethod: { [key: string]: number } = {
const mapLevelToMethod: Record<string, number> = {
silly: 0,
trace: 1,
debug: 2,
Expand All @@ -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,
Expand Down Expand Up @@ -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']
Expand All @@ -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']
}

Expand Down

0 comments on commit c0624eb

Please sign in to comment.