From 0a35ed499e45918fc5e3735b85e015a20bb82177 Mon Sep 17 00:00:00 2001 From: Cooper Date: Mon, 10 Apr 2023 12:32:22 -0400 Subject: [PATCH 1/5] 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 () => { From 0561ba89620ef690e74a82f00c378aa655a86490 Mon Sep 17 00:00:00 2001 From: Cooper Date: Mon, 10 Apr 2023 13:05:55 -0400 Subject: [PATCH 2/5] fix(action): use dockerfile --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 1a0c217..c301cc2 100644 --- a/action.yml +++ b/action.yml @@ -44,7 +44,7 @@ outputs: description: The error and warning messages for each one of the analyzed commits runs: using: docker - image: docker://wagoid/commitlint-github-action:5.3.1 + image: Dockerfile branding: icon: check-square color: blue From 09fdc594834fda031fa27ce7f95d89da8ef68dc8 Mon Sep 17 00:00:00 2001 From: Cooper Date: Mon, 10 Apr 2023 14:50:03 -0400 Subject: [PATCH 3/5] fix(action): add docker image back to yml --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index c301cc2..1a0c217 100644 --- a/action.yml +++ b/action.yml @@ -44,7 +44,7 @@ outputs: description: The error and warning messages for each one of the analyzed commits runs: using: docker - image: Dockerfile + image: docker://wagoid/commitlint-github-action:5.3.1 branding: icon: check-square color: blue From 00cf65022ffbecf121f0ac4d7158772d57e35735 Mon Sep 17 00:00:00 2001 From: Cooper Date: Mon, 10 Apr 2023 15:05:29 -0400 Subject: [PATCH 4/5] fix(action): move info sequence for failonerrors --- src/action.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/action.js b/src/action.js index fe124d7..5cf6d41 100644 --- a/src/action.js +++ b/src/action.js @@ -149,8 +149,8 @@ const showLintResults = async ([from, to]) => { // https://github.com/actions/toolkit/tree/master/packages/core#exit-codes // 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 ✅') console.log(formattedResults) + console.log('Passing despite errors ✅') } else if (formattedResults) { setFailedAction(formattedResults) } else { From d4e1e800cd5f24869c63b725ca461da53cc8b419 Mon Sep 17 00:00:00 2001 From: Cooper Date: Mon, 10 Apr 2023 15:10:08 -0400 Subject: [PATCH 5/5] fix(action): move info sequence for failonerrors --- src/action.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/action.js b/src/action.js index 5cf6d41..5c72a4e 100644 --- a/src/action.js +++ b/src/action.js @@ -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(formattedResults) - console.log('Passing despite errors ✅') + console.log('Fail on Errors is set to false: Passing despite errors ✅') } else if (formattedResults) { setFailedAction(formattedResults) } else {