Skip to content

Commit b7fae1f

Browse files
committed
refactor(test): add option to disable comment on label check
1 parent 6eb68ab commit b7fae1f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

test/label/check/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ inputs:
1414
description: 'Name of the test type used in comments (e.g. Robot)'
1515
required: false
1616
default: 'Test'
17+
post-comment:
18+
description: 'Whether to post a comment on the PR'
19+
required: false
20+
default: 'true'
1721
token:
1822
description: 'GitHub token or PAT used to post comments (defaults to github.token)'
1923
required: false
@@ -33,7 +37,9 @@ runs:
3337
const { number: pr, head: { sha } } = context.payload.pull_request;
3438
const repo = context.repo;
3539
40+
const postCommentEnabled = '${{ inputs.post-comment }}' !== 'false';
3641
const postComment = async (body) => {
42+
if (!postCommentEnabled) { core.info('post-comment is disabled. Skipping comment.'); return; }
3743
try {
3844
await github.rest.issues.createComment({ ...repo, issue_number: pr, body });
3945
} catch (err) {

0 commit comments

Comments
 (0)