Skip to content

Commit

Permalink
Add an init info line, debug log parameter fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
Barry Gordon committed Sep 28, 2021
1 parent 587b6eb commit 03c3e72
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 38 deletions.
48 changes: 11 additions & 37 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {WorkflowDispatchEvent} from '@octokit/webhooks-definitions/schema'
import {JobParameters} from './api-client'

export function getJobParameters(ctx: Context): JobParameters | null {
core.debug(`Detecting '${ctx.eventName}' event.`)

switch (ctx.eventName) {
case 'dynamic':
case 'workflow_dispatch':
Expand All @@ -18,6 +20,8 @@ export function getJobParameters(ctx: Context): JobParameters | null {
function fromWorkflowInputs(ctx: Context): JobParameters {
const evt = ctx.payload as WorkflowDispatchEvent

core.debug(JSON.stringify(evt.inputs))

const dependabotApiDockerUrl =
evt.inputs.dependabotApiDockerUrl || evt.inputs.dependabotApiUrl

Expand Down
2 changes: 2 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ export enum DependabotErrorType {

export async function run(context: Context): Promise<void> {
try {
core.info('🤖 ~start~')
// Decode JobParameters:
const params = getJobParameters(context)
if (params === null) {
core.setFailed('no parameters!')
return // No parameters, nothing to do
}

Expand Down

0 comments on commit 03c3e72

Please sign in to comment.