Skip to content

Commit 7a9e2e0

Browse files
authored
Merge pull request #4111 from Blargian/addendum_approval_improvements_3
Legal: more improvements to approval flow
2 parents 8574d4b + 59715ca commit 7a9e2e0

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

.github/workflows/trademark-cla-approval.yml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
token: ${{ steps.generate-token.outputs.token || secrets.GITHUB_TOKEN }}
3737

3838
- name: Process CLA approval
39+
id: process-cla-approval
3940
uses: actions/github-script@v7
4041
with:
4142
github-token: ${{ steps.generate-token.outputs.token || secrets.GITHUB_TOKEN }}
@@ -88,24 +89,15 @@ jobs:
8889
pull_number: prNumber
8990
});
9091
91-
// Verify the commenter is the PR author and the signature matches
92+
// If someone other than PR author is trying to sign, silently ignore
9293
if (commenter !== pr.user.login) {
93-
await github.rest.issues.createComment({
94-
owner: context.repo.owner,
95-
repo: context.repo.repo,
96-
issue_number: prNumber,
97-
body: `@${commenter} Only the PR author (@${pr.user.login}) can sign the CLA for this pull request.`
98-
});
94+
console.log(`Comment with CLA text from ${commenter} (not PR author ${pr.user.login}), ignoring silently`);
9995
return;
10096
}
10197
98+
// If PR author is signing but signature doesn't match their username, silently ignore
10299
if (signatureUser !== commenter) {
103-
await github.rest.issues.createComment({
104-
owner: context.repo.owner,
105-
repo: context.repo.repo,
106-
issue_number: prNumber,
107-
body: `@${commenter} The CLA signature must match your username. Please use: \`CLA-SIGNATURE: ${commenter}\``
108-
});
100+
console.log(`PR author ${commenter} used incorrect signature '${signatureUser}', ignoring silently`);
109101
return;
110102
}
111103
@@ -219,6 +211,8 @@ jobs:
219211
core.setOutput('pr_author', prAuthor);
220212
core.setOutput('approved_by', approvedBy);
221213
214+
console.log(`Outputs set - pr_number: ${prNumber}, pr_author: ${prAuthor}, approved_by: ${approvedBy}`);
215+
222216
// Check if confirmation comment already exists
223217
const comments = await github.rest.issues.listComments({
224218
issue_number: prNumber,
@@ -228,7 +222,7 @@ jobs:
228222
229223
const confirmationExists = comments.data.some(comment =>
230224
(comment.user.login === 'github-actions[bot]' || comment.user.type === 'Bot') &&
231-
comment.body.includes('CLA Agreement Confirmed')
225+
comment.body.includes('Trademark addendum agreement confirmed ✅')
232226
);
233227
234228
if (!confirmationExists) {
@@ -239,7 +233,7 @@ jobs:
239233
owner: context.repo.owner,
240234
repo: context.repo.repo,
241235
issue_number: prNumber,
242-
body: `## CLA Agreement Confirmed
236+
body: `## Trademark license agreement confirmed
243237
244238
The trademark license agreement has been approved for @${prAuthor}.
245239

.github/workflows/trademark-cla-notice.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ jobs:
170170
171171
if (!existingClaComment && context.eventName === 'pull_request_target') {
172172
const claText = '# Trademark License Addendum\n\n' +
173-
'Merging of this pull request is temporarily blocked. Please \n' +
173+
'Merging of this pull request is temporarily blocked as it potentially
174+
'contains a contribution containing a trademark. Please \n' +
174175
'read and agree to the Trademark License Addendum below to \n' +
175176
'unblock merging of this pull request.\n\n' +
176177
'<details>\n' +

0 commit comments

Comments
 (0)