Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
dependabot-action/src/cli.ts
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
36 lines (31 sloc)
909 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |