Skip to content

Commit d755a68

Browse files
authored
Merge pull request #158 from kingthorin/recheck-param
Add an option to disable the "recheck" part of the comment
2 parents fdca7a0 + ca58bcf commit d755a68

File tree

5 files changed

+61
-5
lines changed

5 files changed

+61
-5
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ This PAT should have repo scope and is only required if you have configured to s
138138
| `custom-pr-sign-comment` | _optional_ | The signature to be committed in order to sign the CLA. | I have read the Developer Terms Document and I hereby accept the Terms |
139139
| `custom-allsigned-prcomment` | _optional_ | pull request comment when everyone has signed | All Contributors have signed the CLA. |
140140
| `lock-pullrequest-aftermerge` | _optional_ | Boolean input for locking the pull request after merging. Default is set to `true`. It is highly recommended to lock the Pull Request after merging so that the Contributors won't be able to revoke their signature comments after merge | false |
141+
| `suggest-recheck` | _optional_ | Boolean input for indicating if the action's comment should suggest that users comment `recheck`. Default is set to `true`. | false |
141142

142143
## Contributors
143144

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ inputs:
3838
lock-pullrequest-aftermerge:
3939
description: "Will lock the pull request after merge so that the signature the contributors cannot revoke their signature comments after merge"
4040
default: "true"
41+
suggest-recheck:
42+
description: "Controls whether or not the action's comment should suggest that users comment `recheck`."
43+
default: "true"
4144
runs:
4245
using: "node20"
4346
main: 'dist/index.js'

dist/index.js

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,9 @@ function dco(signed, committerMap) {
699699
text += `**${committerNames.join(", ")}** ${seem} not to be a GitHub user.`;
700700
text += ' You need a GitHub account to be able to sign the DCO. If you have already a GitHub account, please [add the email address used for this commit to your account](https://help.github.com/articles/why-are-my-commits-linked-to-the-wrong-user/#commits-are-not-linked-to-any-user).<br/>';
701701
}
702-
text += '<sub>You can retrigger this bot by commenting **recheck** in this Pull Request. Posted by the ****DCO Assistant Lite bot****.</sub>';
702+
if (input.suggestRecheck() == 'true') {
703+
text += '<sub>You can retrigger this bot by commenting **recheck** in this Pull Request. Posted by the ****DCO Assistant Lite bot****.</sub>';
704+
}
703705
return text;
704706
}
705707
function cla(signed, committerMap) {
@@ -733,7 +735,9 @@ function cla(signed, committerMap) {
733735
text += `**${committerNames.join(", ")}** ${seem} not to be a GitHub user.`;
734736
text += ' You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please [add the email address used for this commit to your account](https://help.github.com/articles/why-are-my-commits-linked-to-the-wrong-user/#commits-are-not-linked-to-any-user).<br/>';
735737
}
736-
text += '<sub>You can retrigger this bot by commenting **recheck** in this Pull Request. Posted by the **CLA Assistant Lite bot**.</sub>';
738+
if (input.suggestRecheck() == 'true') {
739+
text += '<sub>You can retrigger this bot by commenting **recheck** in this Pull Request. Posted by the **CLA Assistant Lite bot**.</sub>';
740+
}
737741
return text;
738742
}
739743

@@ -1054,7 +1058,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
10541058
return result;
10551059
};
10561060
Object.defineProperty(exports, "__esModule", ({ value: true }));
1057-
exports.lockPullRequestAfterMerge = exports.getCustomPrSignComment = exports.getUseDcoFlag = exports.getCustomAllSignedPrComment = exports.getCustomNotSignedPrComment = exports.getCreateFileCommitMessage = exports.getSignedCommitMessage = exports.getEmptyCommitFlag = exports.getAllowListItem = exports.getBranch = exports.getPathToDocument = exports.getPathToSignatures = exports.getRemoteOrgName = exports.getRemoteRepoName = void 0;
1061+
exports.suggestRecheck = exports.lockPullRequestAfterMerge = exports.getCustomPrSignComment = exports.getUseDcoFlag = exports.getCustomAllSignedPrComment = exports.getCustomNotSignedPrComment = exports.getCreateFileCommitMessage = exports.getSignedCommitMessage = exports.getEmptyCommitFlag = exports.getAllowListItem = exports.getBranch = exports.getPathToDocument = exports.getPathToSignatures = exports.getRemoteOrgName = exports.getRemoteRepoName = void 0;
10581062
const core = __importStar(__nccwpck_require__(2186));
10591063
const getRemoteRepoName = () => {
10601064
return core.getInput('remote-repository-name', { required: false });
@@ -1088,6 +1092,47 @@ const getCustomPrSignComment = () => core.getInput('custom-pr-sign-comment', { r
10881092
exports.getCustomPrSignComment = getCustomPrSignComment;
10891093
const lockPullRequestAfterMerge = () => core.getInput('lock-pullrequest-aftermerge', { required: false });
10901094
exports.lockPullRequestAfterMerge = lockPullRequestAfterMerge;
1095+
const suggestRecheck = () => core.getInput('suggest-recheck', { required: false });
1096+
exports.suggestRecheck = suggestRecheck;
1097+
1098+
1099+
/***/ }),
1100+
1101+
/***/ 6718:
1102+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
1103+
1104+
"use strict";
1105+
1106+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
1107+
if (k2 === undefined) k2 = k;
1108+
var desc = Object.getOwnPropertyDescriptor(m, k);
1109+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1110+
desc = { enumerable: true, get: function() { return m[k]; } };
1111+
}
1112+
Object.defineProperty(o, k2, desc);
1113+
}) : (function(o, m, k, k2) {
1114+
if (k2 === undefined) k2 = k;
1115+
o[k2] = m[k];
1116+
}));
1117+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
1118+
Object.defineProperty(o, "default", { enumerable: true, value: v });
1119+
}) : function(o, v) {
1120+
o["default"] = v;
1121+
});
1122+
var __importStar = (this && this.__importStar) || function (mod) {
1123+
if (mod && mod.__esModule) return mod;
1124+
var result = {};
1125+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1126+
__setModuleDefault(result, mod);
1127+
return result;
1128+
};
1129+
Object.defineProperty(exports, "__esModule", ({ value: true }));
1130+
exports.getPrSignComment = void 0;
1131+
const input = __importStar(__nccwpck_require__(3611));
1132+
function getPrSignComment() {
1133+
return input.getCustomPrSignComment() || "I have read the CLA Document and I hereby sign the CLA";
1134+
}
1135+
exports.getPrSignComment = getPrSignComment;
10911136

10921137

10931138
/***/ }),

src/pullrequest/pullRequestCommentContent.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ function dco(signed: boolean, committerMap: CommitterMap): string {
5151
text += ' You need a GitHub account to be able to sign the DCO. If you have already a GitHub account, please [add the email address used for this commit to your account](https://help.github.com/articles/why-are-my-commits-linked-to-the-wrong-user/#commits-are-not-linked-to-any-user).<br/>'
5252
}
5353

54-
text += '<sub>You can retrigger this bot by commenting **recheck** in this Pull Request. Posted by the ****DCO Assistant Lite bot****.</sub>'
54+
if (input.suggestRecheck() == 'true') {
55+
text += '<sub>You can retrigger this bot by commenting **recheck** in this Pull Request. Posted by the ****DCO Assistant Lite bot****.</sub>'
56+
}
5557
return text
5658
}
5759

@@ -93,6 +95,8 @@ function cla(signed: boolean, committerMap: CommitterMap): string {
9395
text += ' You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please [add the email address used for this commit to your account](https://help.github.com/articles/why-are-my-commits-linked-to-the-wrong-user/#commits-are-not-linked-to-any-user).<br/>'
9496
}
9597

96-
text += '<sub>You can retrigger this bot by commenting **recheck** in this Pull Request. Posted by the **CLA Assistant Lite bot**.</sub>'
98+
if (input.suggestRecheck() == 'true') {
99+
text += '<sub>You can retrigger this bot by commenting **recheck** in this Pull Request. Posted by the **CLA Assistant Lite bot**.</sub>'
100+
}
97101
return text
98102
}

src/shared/getInputs.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,6 @@ export const getCustomPrSignComment = (): string =>
4343

4444
export const lockPullRequestAfterMerge = (): string =>
4545
core.getInput('lock-pullrequest-aftermerge', { required: false })
46+
47+
export const suggestRecheck = (): string =>
48+
core.getInput('suggest-recheck', { required: false })

0 commit comments

Comments
 (0)