5
0
Fork 0
mirror of https://github.com/wagoid/commitlint-github-action.git synced 2025-11-07 08:06:54 +00:00

fix(action): removed unnecessary setOutput call

This commit is contained in:
Cooper 2023-04-10 12:32:22 -04:00
parent 097b726807
commit 0a35ed499e
No known key found for this signature in database
GPG key ID: DF6ECEF0888ECA4B
2 changed files with 4 additions and 4 deletions

View file

@ -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'
@ -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 {

View file

@ -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 () => {