fix: resolve prettier and eslint conflict by removing bracketSpacing: false
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {spawnSync, SpawnSyncReturns} from 'child_process'
|
||||
import { spawnSync, SpawnSyncReturns } from 'child_process'
|
||||
import stripAnsi from 'strip-ansi'
|
||||
|
||||
const SPAWN_PROCESS_BUFFER_SIZE = 10485760 // 10MiB
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as core from '@actions/core'
|
||||
import {IssueOption} from './interface.js'
|
||||
import { IssueOption } from './interface.js'
|
||||
|
||||
export function getIssueOption(body: string): IssueOption {
|
||||
let assignees: string[] | undefined
|
||||
@@ -29,7 +29,7 @@ export type GetIssuesFunc = (options: {
|
||||
state: 'open' | 'closed' | 'all' | undefined
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
[key: string]: any // Allow additional properties
|
||||
}) => Promise<{data: Array<{title: string; number: number}>}>
|
||||
}) => Promise<{ data: Array<{ title: string; number: number }> }>
|
||||
|
||||
export async function getExistingIssueNumber(
|
||||
getIssues: GetIssuesFunc,
|
||||
@@ -38,7 +38,7 @@ export async function getExistingIssueNumber(
|
||||
repo: string
|
||||
}
|
||||
): Promise<number | null> {
|
||||
const {data: issues} = await getIssues({
|
||||
const { data: issues } = await getIssues({
|
||||
...repo,
|
||||
state: 'open'
|
||||
})
|
||||
|
||||
18
src/main.ts
18
src/main.ts
@@ -1,8 +1,8 @@
|
||||
import * as core from '@actions/core'
|
||||
import * as github from '@actions/github'
|
||||
import {Octokit} from '@octokit/rest'
|
||||
import {Audit} from './audit.js'
|
||||
import {IssueOption} from './interface.js'
|
||||
import { Octokit } from '@octokit/rest'
|
||||
import { Audit } from './audit.js'
|
||||
import { IssueOption } from './interface.js'
|
||||
import * as issue from './issue.js'
|
||||
import * as pr from './pr.js'
|
||||
import * as workdir from './workdir.js'
|
||||
@@ -20,7 +20,7 @@ export async function run(): Promise<void> {
|
||||
core.info(`Current working directory: ${process.cwd()}`)
|
||||
|
||||
// get audit-level
|
||||
const auditLevel = core.getInput('audit_level', {required: true})
|
||||
const auditLevel = core.getInput('audit_level', { required: true })
|
||||
if (
|
||||
!['critical', 'high', 'moderate', 'low', 'info', 'none'].includes(
|
||||
auditLevel
|
||||
@@ -29,12 +29,12 @@ export async function run(): Promise<void> {
|
||||
throw new Error('Invalid input: audit_level')
|
||||
}
|
||||
|
||||
const productionFlag = core.getInput('production_flag', {required: false})
|
||||
const productionFlag = core.getInput('production_flag', { required: false })
|
||||
if (!['true', 'false'].includes(productionFlag)) {
|
||||
throw new Error('Invalid input: production_flag')
|
||||
}
|
||||
|
||||
const jsonFlag = core.getInput('json_flag', {required: false})
|
||||
const jsonFlag = core.getInput('json_flag', { required: false })
|
||||
if (!['true', 'false'].includes(jsonFlag)) {
|
||||
throw new Error('Invalid input: json_flag')
|
||||
}
|
||||
@@ -50,7 +50,7 @@ export async function run(): Promise<void> {
|
||||
|
||||
// get GitHub information
|
||||
const ctx = JSON.parse(core.getInput('github_context'))
|
||||
const token: string = core.getInput('github_token', {required: true})
|
||||
const token: string = core.getInput('github_token', { required: true })
|
||||
const octokit = new Octokit({
|
||||
auth: token
|
||||
})
|
||||
@@ -97,14 +97,14 @@ export async function run(): Promise<void> {
|
||||
: null
|
||||
|
||||
if (existingIssueNumber !== null) {
|
||||
const {data: createdComment} = await octokit.issues.createComment({
|
||||
const { data: createdComment } = await octokit.issues.createComment({
|
||||
...github.context.repo,
|
||||
issue_number: existingIssueNumber,
|
||||
body: option.body
|
||||
})
|
||||
core.debug(`comment ${createdComment.url}`)
|
||||
} else {
|
||||
const {data: createdIssue} = await octokit.issues.create({
|
||||
const { data: createdIssue } = await octokit.issues.create({
|
||||
...github.context.repo,
|
||||
...option
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user