Skip to content

Commit 9dfcfbe

Browse files
authored
Merge pull request #140 from Holzhaus/botname-subscript
Move CLA/DCO bot name into subscript at end of comment
2 parents 9c07d10 + 1e0e0b9 commit 9dfcfbe

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

dist/index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -592,10 +592,10 @@ function getComment() {
592592
//TODO: check the below regex
593593
// using a `string` true or false purposely as github action input cannot have a boolean value
594594
if ((0, getInputs_1.getUseDcoFlag)() === 'true') {
595-
return response.data.find(comment => comment.body.match(/.*DCO Assistant Lite bot.*/));
595+
return response.data.find(comment => comment.body.match(/.*DCO Assistant Lite bot.*/m));
596596
}
597597
else if ((0, getInputs_1.getUseDcoFlag)() === 'false') {
598-
return response.data.find(comment => comment.body.match(/.*CLA Assistant Lite bot.*/));
598+
return response.data.find(comment => comment.body.match(/.*CLA Assistant Lite bot.*/m));
599599
}
600600
}
601601
catch (error) {
@@ -670,7 +670,7 @@ exports.commentContent = commentContent;
670670
function dco(signed, committerMap) {
671671
if (signed) {
672672
const line1 = input.getCustomAllSignedPrComment() || `All contributors have signed the DCO ✍️ ✅`;
673-
const text = `****DCO Assistant Lite bot**** ${line1}`;
673+
const text = `${line1}<br/><sub>Posted by the ****DCO Assistant Lite bot****.</sub>`;
674674
return text;
675675
}
676676
let committersCount = 1;
@@ -679,7 +679,7 @@ function dco(signed, committerMap) {
679679
}
680680
let you = committersCount > 1 ? `you all` : `you`;
681681
let lineOne = (input.getCustomNotSignedPrComment() || `<br/>Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that $you sign our [Developer Certificate of Origin](${input.getPathToDocument()}) before we can accept your contribution. You can sign the DCO by just posting a Pull Request Comment same as the below format.<br/>`).replace('$you', you);
682-
let text = `**DCO Assistant Lite bot:** ${lineOne}
682+
let text = `${lineOne}
683683
- - -
684684
${input.getCustomPrSignComment() || "I have read the DCO Document and I hereby sign the DCO"}
685685
- - -
@@ -698,13 +698,13 @@ function dco(signed, committerMap) {
698698
text += `**${committerNames.join(", ")}** ${seem} not to be a GitHub user.`;
699699
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/>';
700700
}
701-
text += '<sub>You can retrigger this bot by commenting **recheck** in this Pull Request</sub>';
701+
text += '<sub>You can retrigger this bot by commenting **recheck** in this Pull Request. Posted by the ****DCO Assistant Lite bot****.</sub>';
702702
return text;
703703
}
704704
function cla(signed, committerMap) {
705705
if (signed) {
706706
const line1 = input.getCustomAllSignedPrComment() || `All contributors have signed the CLA ✍️ ✅`;
707-
const text = `****CLA Assistant Lite bot**** ${line1}`;
707+
const text = `${line1}<br/><sub>Posted by the ****CLA Assistant Lite bot****.</sub>`;
708708
return text;
709709
}
710710
let committersCount = 1;
@@ -713,7 +713,7 @@ function cla(signed, committerMap) {
713713
}
714714
let you = committersCount > 1 ? `you all` : `you`;
715715
let lineOne = (input.getCustomNotSignedPrComment() || `<br/>Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that $you sign our [Contributor License Agreement](${input.getPathToDocument()}) before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.<br/>`).replace('$you', you);
716-
let text = `**CLA Assistant Lite bot:** ${lineOne}
716+
let text = `${lineOne}
717717
- - -
718718
${input.getCustomPrSignComment() || "I have read the CLA Document and I hereby sign the CLA"}
719719
- - -
@@ -732,7 +732,7 @@ function cla(signed, committerMap) {
732732
text += `**${committerNames.join(", ")}** ${seem} not to be a GitHub user.`;
733733
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/>';
734734
}
735-
text += '<sub>You can retrigger this bot by commenting **recheck** in this Pull Request</sub>';
735+
text += '<sub>You can retrigger this bot by commenting **recheck** in this Pull Request. Posted by the **CLA Assistant Lite bot**.</sub>';
736736
return text;
737737
}
738738

src/pullrequest/pullRequestComment.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ async function getComment() {
6262
//TODO: check the below regex
6363
// using a `string` true or false purposely as github action input cannot have a boolean value
6464
if (getUseDcoFlag() === 'true') {
65-
return response.data.find(comment => comment.body.match(/.*DCO Assistant Lite bot.*/))
65+
return response.data.find(comment => comment.body.match(/.*DCO Assistant Lite bot.*/m))
6666
} else if (getUseDcoFlag() === 'false') {
67-
return response.data.find(comment => comment.body.match(/.*CLA Assistant Lite bot.*/))
67+
return response.data.find(comment => comment.body.match(/.*CLA Assistant Lite bot.*/m))
6868
}
6969
} catch (error) {
7070
throw new Error(`Error occured when getting all the comments of the pull request: ${error.message}`)

src/pullrequest/pullRequestCommentContent.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function dco(signed: boolean, committerMap: CommitterMap): string {
1717

1818
if (signed) {
1919
const line1 = input.getCustomAllSignedPrComment() || `All contributors have signed the DCO ✍️ ✅`
20-
const text = `****DCO Assistant Lite bot**** ${line1}`
20+
const text = `${line1}<br/><sub>Posted by the ****DCO Assistant Lite bot****.</sub>`
2121
return text
2222
}
2323
let committersCount = 1
@@ -29,7 +29,7 @@ function dco(signed: boolean, committerMap: CommitterMap): string {
2929

3030
let you = committersCount > 1 ? `you all` : `you`
3131
let lineOne = (input.getCustomNotSignedPrComment() || `<br/>Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that $you sign our [Developer Certificate of Origin](${input.getPathToDocument()}) before we can accept your contribution. You can sign the DCO by just posting a Pull Request Comment same as the below format.<br/>`).replace('$you', you)
32-
let text = `**DCO Assistant Lite bot:** ${lineOne}
32+
let text = `${lineOne}
3333
- - -
3434
${input.getCustomPrSignComment() || "I have read the DCO Document and I hereby sign the DCO"}
3535
- - -
@@ -51,15 +51,15 @@ 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</sub>'
54+
text += '<sub>You can retrigger this bot by commenting **recheck** in this Pull Request. Posted by the ****DCO Assistant Lite bot****.</sub>'
5555
return text
5656
}
5757

5858
function cla(signed: boolean, committerMap: CommitterMap): string {
5959

6060
if (signed) {
6161
const line1 = input.getCustomAllSignedPrComment() || `All contributors have signed the CLA ✍️ ✅`
62-
const text = `****CLA Assistant Lite bot**** ${line1}`
62+
const text = `${line1}<br/><sub>Posted by the ****CLA Assistant Lite bot****.</sub>`
6363
return text
6464
}
6565
let committersCount = 1
@@ -71,7 +71,7 @@ function cla(signed: boolean, committerMap: CommitterMap): string {
7171

7272
let you = committersCount > 1 ? `you all` : `you`
7373
let lineOne = (input.getCustomNotSignedPrComment() || `<br/>Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that $you sign our [Contributor License Agreement](${input.getPathToDocument()}) before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.<br/>`).replace('$you', you)
74-
let text = `**CLA Assistant Lite bot:** ${lineOne}
74+
let text = `${lineOne}
7575
- - -
7676
${getPrSignComment()}
7777
- - -
@@ -93,6 +93,6 @@ function cla(signed: boolean, committerMap: CommitterMap): string {
9393
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/>'
9494
}
9595

96-
text += '<sub>You can retrigger this bot by commenting **recheck** in this Pull Request</sub>'
96+
text += '<sub>You can retrigger this bot by commenting **recheck** in this Pull Request. Posted by the **CLA Assistant Lite bot**.</sub>'
9797
return text
9898
}

0 commit comments

Comments
 (0)