Skip to content

Commit

Permalink
Add some error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Jurre Stender committed Aug 30, 2021
1 parent 229ee01 commit 48ab5b7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export async function run(context: Context): Promise<void> {
return // No parameters, nothing to do
}

core.info('Starting updater')

core.debug(JSON.stringify(params))

core.setSecret(params.jobToken)
Expand All @@ -35,6 +37,8 @@ export async function run(context: Context): Promise<void> {
const apiClient = new APIClient(client, params)

try {
core.info('Fetching job details')

const details = await apiClient.getJobDetails()
const credentials = await apiClient.getCredentials()
const updater = new Updater(
Expand All @@ -46,16 +50,23 @@ export async function run(context: Context): Promise<void> {
)

try {
core.info('Pulling updater and proxy images')

await ImageService.pull(UPDATER_IMAGE_NAME)
await ImageService.pull(PROXY_IMAGE_NAME)
} catch (error) {
core.error('Error fetching updater and proxy images')

await failJob(apiClient, error, DependabotErrorType.Image)
return
}

try {
core.info('Starting update process')

await updater.runUpdater()
} catch (error) {
core.error('Error performing update')
await failJob(apiClient, error, DependabotErrorType.UpdateRun)
return
}
Expand Down

0 comments on commit 48ab5b7

Please sign in to comment.