File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
@@ -34,13 +38,15 @@ runs:
3438 const repo = context.repo;
3539
3640 const postComment = async (body) => {
41+ if (!postCommentEnabled) { core.info('post-comment is disabled. Skipping comment.'); return; }
3742 try {
3843 await github.rest.issues.createComment({ ...repo, issue_number: pr, body });
3944 } catch (err) {
4045 core.warning(`Could not post comment: ${err.message}`);
4146 }
4247 };
4348
49+ const postCommentEnabled = '${{ inputs.post-comment }}' !== 'false';
4450 const { data: labels } = await github.rest.issues.listLabelsOnIssue({ ...repo, issue_number: pr });
4551 const has = new Set(labels.map(l => l.name));
4652 const shaLine = sha ? `\n\n**Commit:** \`${sha}\`` : '';
Original file line number Diff line number Diff 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 remove labels and post comments (defaults to github.token)'
1923 required : false
@@ -34,13 +38,15 @@ runs:
3438 const repo = context.repo;
3539
3640 const postComment = async (body) => {
41+ if (!postCommentEnabled) { core.info('post-comment is disabled. Skipping comment.'); return; }
3742 try {
3843 await github.rest.issues.createComment({ ...repo, issue_number: pr, body });
3944 } catch (err) {
4045 core.warning(`Could not post comment: ${err.message}`);
4146 }
4247 };
4348
49+ const postCommentEnabled = '${{ inputs.post-comment }}' !== 'false';
4450 const { data: labels } = await github.rest.issues.listLabelsOnIssue({ ...repo, issue_number: pr });
4551 const has = new Set(labels.map(l => l.name));
4652
You can’t perform that action at this time.
0 commit comments