From 7d4a2f6e37f079426ffc2a86e366052a79593920 Mon Sep 17 00:00:00 2001 From: kevintyj Date: Fri, 24 Nov 2023 20:57:26 +0530 Subject: [PATCH] feat: Specify github action output --- action.yml | 5 +++++ dist/index.js | 3 ++- src/lint.ts | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 1ac0764..f47d9f6 100644 --- a/action.yml +++ b/action.yml @@ -4,6 +4,11 @@ description: Ensure PR title match commitlint config runs: using: node20 main: dist/index.js +outputs: + lint-status: + description: The status of the PR lint + lint-details: + description: The output of the PR lint from commitlint branding: icon: git-pull-request color: green diff --git a/dist/index.js b/dist/index.js index e9b4e32..a3fb08e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -253179,7 +253179,8 @@ function verifyTitle(title, configPath = '') { : yield (0, load_1.default)(defaultConfig); const linterResult = yield (0, lint_1.default)(title, commitlintConfig.rules, getLintOptions(commitlintConfig)); if (linterResult.valid) { - (0, core_1.setOutput)('✅ Commitlint tests passed!\n', linterResult); + (0, core_1.setOutput)('lint-status', '✅ Commitlint tests passed!\n'); + (0, core_1.setOutput)('lint-details', linterResult); return true; } else { diff --git a/src/lint.ts b/src/lint.ts index a251dd7..e87d6fa 100644 --- a/src/lint.ts +++ b/src/lint.ts @@ -45,7 +45,8 @@ export async function verifyTitle(title: string, configPath: string = ''): Promi const linterResult = await lint(title, commitlintConfig.rules, getLintOptions(commitlintConfig)); if (linterResult.valid) { - setOutput('✅ Commitlint tests passed!\n', linterResult); + setOutput('lint-status', '✅ Commitlint tests passed!\n'); + setOutput('lint-details', linterResult); return true; } else {