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