Skip to content

Commit

Permalink
feat: Specify github action output
Browse files Browse the repository at this point in the history
  • Loading branch information
kevintyj committed Nov 24, 2023
1 parent 726e06f commit 7d4a2f6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion src/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7d4a2f6

Please sign in to comment.