From 0a35ed499e45918fc5e3735b85e015a20bb82177 Mon Sep 17 00:00:00 2001 From: Cooper Date: Mon, 10 Apr 2023 12:32:22 -0400 Subject: [PATCH] fix(action): removed unnecessary setOutput call --- src/action.js | 4 ++-- src/action.test.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/action.js b/src/action.js index d1cf47f..fe124d7 100644 --- a/src/action.js +++ b/src/action.js @@ -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 { diff --git a/src/action.test.js b/src/action.test.js index 3c1ef94..89f5dc3 100644 --- a/src/action.test.js +++ b/src/action.test.js @@ -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 () => {