Skip to content

Commit

Permalink
Replace error with inline info
Browse files Browse the repository at this point in the history
  • Loading branch information
szapp committed Apr 11, 2024
1 parent 3850867 commit b715eb1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
6 changes: 1 addition & 5 deletions __tests__/cleanup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ describe('cleanup', () => {
jest.spyOn(core.summary, 'addRaw').mockImplementation(() => core.summary)
jest.spyOn(core.summary, 'write').mockImplementation()
jest.spyOn(core, 'info').mockImplementation()
jest.spyOn(core, 'error').mockImplementation()
jest.spyOn(core, 'setFailed').mockImplementation()
jest.spyOn(core, 'getInput').mockReturnValue('CheckName')
jest.spyOn(process, 'exit').mockImplementation()
Expand All @@ -90,7 +89,6 @@ describe('cleanup', () => {
expect(core.summary.addHeading).not.toHaveBeenCalled()
expect(core.summary.addRaw).not.toHaveBeenCalled()
expect(core.summary.write).not.toHaveBeenCalled()
expect(core.error).not.toHaveBeenCalled()
expect(core.setFailed).not.toHaveBeenCalled()
expect(process.exit).not.toHaveBeenCalled()
})
Expand All @@ -113,7 +111,6 @@ describe('cleanup', () => {
expect(core.summary.addHeading).not.toHaveBeenCalled()
expect(core.summary.addRaw).not.toHaveBeenCalled()
expect(core.summary.write).not.toHaveBeenCalled()
expect(core.error).not.toHaveBeenCalled()
expect(core.setFailed).toHaveBeenCalledWith('This action is only intended to be run on the "CheckName" check run')
})

Expand Down Expand Up @@ -167,7 +164,6 @@ describe('cleanup', () => {
expect(core.summary.addHeading).toHaveBeenCalledWith(github.context.payload.check_run.name)
expect(core.summary.addRaw).toHaveBeenCalledWith(`<a href="${github.context.payload.check_run.html_url}">Details</a>`, true)
expect(core.summary.write).toHaveBeenCalledWith({ overwrite: false })
expect(core.error).not.toHaveBeenCalled()
expect(core.setFailed).not.toHaveBeenCalled()
expect(process.exitCode).toBe(core.ExitCode.Success)
})
Expand Down Expand Up @@ -208,7 +204,7 @@ describe('cleanup', () => {
expect(core.summary.addHeading).toHaveBeenCalledWith(github.context.payload.check_run.name)
expect(core.summary.addRaw).toHaveBeenCalledWith(`<a href="${github.context.payload.check_run.html_url}">Details</a>`, true)
expect(core.summary.write).toHaveBeenCalledWith({ overwrite: false })
expect(core.error).toHaveBeenCalledWith(new Error('Delete error'))
expect(core.info).toHaveBeenCalledWith(`\u001b[32m${new Error('Delete error')}\u001b[0m`)
expect(core.setFailed).not.toHaveBeenCalled()
expect(process.exitCode).toBe(core.ExitCode.Failure)
})
Expand Down
2 changes: 1 addition & 1 deletion 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.

2 changes: 1 addition & 1 deletion src/cleanup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export async function workflow(): Promise<boolean> {
...github.context.repo,
run_id: w.id,
})
.catch((error) => core.error(error))
.catch((error) => core.info(`\u001b[32m${error}\u001b[0m`))
)
)

Expand Down

0 comments on commit b715eb1

Please sign in to comment.