Skip to content

Commit

Permalink
Prefer to use warning annotations when noop-ing
Browse files Browse the repository at this point in the history
  • Loading branch information
Barry Gordon committed Oct 20, 2021
1 parent 0d9169c commit 56d3411
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 3 additions & 2 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ describe('run', () => {
reportJobErrorSpy = jest.spyOn(ApiClient.prototype, 'reportJobError')

jest.spyOn(core, 'info').mockImplementation(jest.fn())
jest.spyOn(core, 'warning').mockImplementation(jest.fn())
jest.spyOn(core, 'setFailed').mockImplementation(jest.fn())

fs.mkdirSync(workingDirectory)
Expand Down Expand Up @@ -78,7 +79,7 @@ describe('run', () => {
await run(context)

expect(core.setFailed).not.toHaveBeenCalled()
expect(core.info).toHaveBeenCalledWith(
expect(core.warning).toHaveBeenCalledWith(
'This workflow can only be triggered by Dependabot.'
)
})
Expand All @@ -101,7 +102,7 @@ describe('run', () => {
await run(context)

expect(core.setFailed).not.toHaveBeenCalled()
expect(core.info).toHaveBeenCalledWith(
expect(core.warning).toHaveBeenCalledWith(
"Dependabot Updater Action does not support 'issue_created' events."
)
})
Expand Down
5 changes: 5 additions & 0 deletions __tests__/updater-integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ describe('Updater', () => {
})

afterEach(async () => {
// Skip the test when we haven't preloaded the updater image
if (process.env.SKIP_INTEGRATION_TESTS) {
return
}

server && server() // teardown server process
await removeDanglingUpdaterContainers()
fs.rmdirSync(workingDirectory, {recursive: true})
Expand Down
4 changes: 2 additions & 2 deletions src/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ export function getJobParameters(ctx: Context): JobParameters | null {
checkEnvironmentAndContext(ctx)

if (ctx.actor !== DEPENDABOT_ACTOR) {
core.info('This workflow can only be triggered by Dependabot.')
core.warning('This workflow can only be triggered by Dependabot.')
return null
}

if (ctx.eventName === DYNAMIC) {
return fromWorkflowInputs(ctx)
} else {
core.info(
core.warning(
`Dependabot Updater Action does not support '${ctx.eventName}' events.`
)
return null
Expand Down

0 comments on commit 56d3411

Please sign in to comment.