forked from github/dependabot-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli.ts
36 lines (31 loc) · 909 Bytes
/
cli.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env node
import {Command} from 'commander'
import {Context} from '@actions/github/lib/context'
import {run} from './main'
const cli = new Command()
cli
.version('0.0.1')
.description('Run an update against the specified Dependabot API service')
.requiredOption('-j, --job-id <id>', 'Job ID is required.')
.requiredOption('-t, --job-token <token>', 'Job token required.')
.requiredOption(
'-c, --credentials-token <token>',
'Job credentials token is required.'
)
.requiredOption(
'-d, --dependabot-api-url <url>',
'A URL for Dependabot API is required.'
)
.option(
'-d, --dependabot-api-docker-url <url>',
'A URL to be used to access the API from Dependabot containers.'
)
.parse(process.argv)
const options = cli.opts()
const ctx = new Context()
ctx.eventName = 'dynamic'
ctx.actor = 'dependabot[bot]'
ctx.payload = {
inputs: options
}
run(ctx)