Skip to content

Commit 3e17dd9

Browse files
committed
fetch all security alerts
1 parent 25dd0e3 commit 3e17dd9

7 files changed

Lines changed: 525 additions & 36 deletions

File tree

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
LOCAL_GITHUB_ACCESS_TOKEN=XXXX
2+
# INPUT_FETCH-DEPTH=0

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ inputs:
2121
type: boolean
2222
description: 'If true, the action will not validate the user or the commit verification status'
2323
default: false
24+
fetch-depth:
25+
description: The number of vulnerability alerts to fetch, <= 0 for all
26+
required: false
27+
default: '0'
2428
outputs:
2529
dependency-names:
2630
description: 'A comma-separated list of all package names updated.'

src/dependabot/util.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { Context } from './github-context'
2+
import { getInput } from '@actions/core'
23

34
export function parseNwo (nwo: string): {owner: string; repo: string} {
45
const [owner, name] = nwo.split('/')
@@ -29,3 +30,13 @@ export function getTitle (context: Context): string {
2930
const { pull_request: pr } = context.payload
3031
return pr?.title || ''
3132
}
33+
34+
export function getNumberInput (inputName: string, defaultVal: number): number;
35+
export function getNumberInput (inputName: string, defaultVal?: number): number | undefined {
36+
const inputStr = getInput(inputName)
37+
let num = Number.parseInt(inputStr, 10)
38+
if (Number.isNaN(num)) {
39+
return defaultVal
40+
}
41+
return num
42+
}

0 commit comments

Comments
 (0)