Skip to content

Commit edcf846

Browse files
committed
Add --no-pr-check to fix command
1 parent ceef059 commit edcf846

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

src/commands/fix/agent-fix.mts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export type FixConfig = {
6868
cwd: string
6969
limit: number
7070
minSatisfying: boolean
71+
noPrCheck: boolean
7172
purls: string[]
7273
rangeStyle: RangeStyle
7374
spinner: Spinner | undefined
@@ -123,6 +124,7 @@ export async function agentFix(
123124
cwd,
124125
limit,
125126
minSatisfying,
127+
noPrCheck,
126128
rangeStyle,
127129
spinner,
128130
test,
@@ -330,7 +332,9 @@ export async function agentFix(
330332
if (seenBranches.has(newVersion)) {
331333
continue infosLoop
332334
}
333-
const pr = prs.find(p => p.headRefName === branch)
335+
const pr = noPrCheck
336+
? undefined
337+
: prs.find(p => p.headRefName === branch)
334338
if (pr) {
335339
debugFn('notice', `skip: PR #${pr.number} for ${name} exists`)
336340
seenBranches.add(branch)

src/commands/fix/cmd-fix.mts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ const config: CliCommandConfig = {
6565
description:
6666
'Constrain dependency updates to the minimum satisfying version',
6767
},
68+
noPrCheck: {
69+
type: 'boolean',
70+
default: false,
71+
description: 'Skip PR existence check',
72+
hidden: true,
73+
},
6874
purl: {
6975
type: 'string',
7076
default: [],
@@ -184,6 +190,7 @@ async function run(
184190
: Infinity) || Infinity
185191
const maxSatisfying = Boolean(cli.flags['maxSatisfying'])
186192
const minSatisfying = Boolean(cli.flags['minSatisfying']) || !maxSatisfying
193+
const noPrCheck = Boolean(cli.flags['noPrCheck'])
187194
const purls = cmdFlagValueToArray(cli.flags['purl'])
188195
const testScript = String(cli.flags['testScript'] || 'test')
189196

@@ -193,6 +200,7 @@ async function run(
193200
ghsas,
194201
limit,
195202
minSatisfying,
203+
noPrCheck,
196204
outputKind,
197205
purls,
198206
rangeStyle,

src/commands/fix/handle-fix.mts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export async function handleFix({
3131
ghsas,
3232
limit,
3333
minSatisfying,
34+
noPrCheck,
3435
outputKind,
3536
purls,
3637
rangeStyle,
@@ -155,6 +156,7 @@ export async function handleFix({
155156
cwd,
156157
limit,
157158
minSatisfying,
159+
noPrCheck,
158160
purls,
159161
rangeStyle,
160162
spinner,

0 commit comments

Comments
 (0)