Skip to content

Commit

Permalink
fix(action): removed unnecessary setOutput call
Browse files Browse the repository at this point in the history
  • Loading branch information
cmitzel-ncino committed Apr 10, 2023
1 parent 097b726 commit 0a35ed4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/action.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { existsSync } from 'fs'
import { resolve } from 'path'
import { getInput, setFailed, setOutput } from '@actions/core'
import { getInput, setFailed } from '@actions/core'
import { context as eventContext, getOctokit } from '@actions/github'
import lint from '@commitlint/lint'
import { format } from '@commitlint/format'
Expand Down Expand Up @@ -150,7 +150,7 @@ const showLintResults = async ([from, to]) => {
// this would be a good place to implement the setNeutral() when it's eventually implimented.
// for now it can pass with a check mark.
console.log('Passing despite errors ✅')
setOutput(`You have commit messages with errors\n\n${formattedResults}`)
console.log(formattedResults)
} else if (formattedResults) {
setFailedAction(formattedResults)
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/action.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ describe('Commit Linter action', () => {
await runAction()

td.verify(core.setFailed(), { times: 0, ignoreExtraArgs: true })
td.verify(console.log(contains('wrong message 1')))
td.verify(console.log(contains('wrong message 2')))
td.verify(console.log(contains('Passing despite errors ✅')))
td.verify(core.setOutput(contains('wrong message 1')))
td.verify(core.setOutput(contains('wrong message 2')))
})

it('should pass for push range with correct messages with failOnErrors set to false', async () => {
Expand Down

0 comments on commit 0a35ed4

Please sign in to comment.