Skip to content

Commit 3fe9b56

Browse files
committed
updates
1 parent 127e107 commit 3fe9b56

File tree

2 files changed

+132
-68
lines changed

2 files changed

+132
-68
lines changed

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

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ jobs:
2727
app-id: "${{ secrets.WORKFLOW_AUTH_PUBLIC_APP_ID }}"
2828
private-key: "${{ secrets.WORKFLOW_AUTH_PUBLIC_PRIVATE_KEY }}"
2929

30+
- name: Check out code
31+
uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0
34+
token: ${{ steps.generate-token.outputs.token || secrets.GITHUB_TOKEN }}
35+
3036
- name: Process CLA approval
3137
uses: actions/github-script@v7
3238
with:
@@ -92,9 +98,9 @@ jobs:
9298
issue_number: prNumber
9399
});
94100
95-
const hasClaMeeded = labels.some(label => label.name === 'cla-required');
101+
const hasClaNeeded = labels.some(label => label.name === 'cla-required');
96102
97-
if (!hasClaMeeded) {
103+
if (!hasClaNeeded) {
98104
return;
99105
}
100106
@@ -123,6 +129,11 @@ jobs:
123129
// Label not found or already removed
124130
}
125131
132+
// Store the manual approval information
133+
core.setOutput('pr_number', prNumber);
134+
core.setOutput('pr_author', pr.user.login);
135+
core.setOutput('approved_by', context.actor);
136+
126137
// Check if confirmation comment already exists
127138
const comments = await github.rest.issues.listComments({
128139
issue_number: prNumber,
@@ -156,3 +167,53 @@ jobs:
156167
} catch (error) {
157168
throw error;
158169
}
170+
171+
- name: Record manual CLA approval
172+
if: steps.process-cla-approval.outputs.pr_number
173+
run: |
174+
# Ensure signatures file exists
175+
if [ ! -f "cla-signatures.json" ]; then
176+
echo '{"signatures": []}' > cla-signatures.json
177+
fi
178+
179+
# Extract approval details from previous step outputs
180+
USERNAME="${{ steps.process-cla-approval.outputs.pr_author }}"
181+
DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
182+
PR_NUMBER="${{ steps.process-cla-approval.outputs.pr_number }}"
183+
APPROVED_BY="${{ steps.process-cla-approval.outputs.approved_by }}"
184+
185+
echo "Recording manual CLA approval:"
186+
echo " Username: $USERNAME"
187+
echo " PR Number: $PR_NUMBER"
188+
echo " Approved by: $APPROVED_BY"
189+
echo " Date: $DATE"
190+
191+
# Check if this user already has a signature for this PR
192+
EXISTING_SIGNATURE=$(jq --arg user "$USERNAME" --arg pr "$PR_NUMBER" '.signatures[] | select(.username == $user and .pr_number == ($pr | tonumber))' cla-signatures.json)
193+
194+
if [ -z "$EXISTING_SIGNATURE" ]; then
195+
# Add new signature entry
196+
jq --arg user "$USERNAME" \
197+
--arg date "$DATE" \
198+
--arg pr "$PR_NUMBER" \
199+
--arg approved_by "$APPROVED_BY" \
200+
'.signatures += [{
201+
"username": $user,
202+
"date": $date,
203+
"pr_number": ($pr | tonumber),
204+
"approved_by": $approved_by
205+
}]' cla-signatures.json > tmp.json && mv tmp.json cla-signatures.json
206+
207+
echo "New CLA approval signature added"
208+
else
209+
echo "Signature already exists for this user and PR"
210+
fi
211+
212+
# Commit the updated file
213+
git config user.name "github-actions[bot]"
214+
git config user.email "github-actions[bot]@users.noreply.github.com"
215+
git add cla-signatures.json
216+
git commit -m "Add manual CLA approval for @$USERNAME (PR #$PR_NUMBER) by @$APPROVED_BY" || echo "No changes to commit"
217+
git push
218+
219+
echo "Manual CLA approval recorded successfully"

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

Lines changed: 69 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -146,72 +146,75 @@ jobs:
146146
);
147147
148148
if (!existingClaComment && context.eventName === 'pull_request') {
149-
const claText = `# CLA Agreement Required - MERGE BLOCKED
150-
151-
# Trademark License Addendum
152-
153-
<details>
154-
<summary>Click to see Trademark License Addendum</summary>
155-
156-
This Trademark License Addendum ("Addendum") shall, if You have opted
157-
in by replying to the comment that references this Addendum that you
158-
have read and agree to theContributor License Agreement Addendum,
159-
supplement the terms of the Individual Contributor License Agreement
160-
between You and the Company ("Agreement"). Capitalized terms not
161-
defined herein shall have the meanings ascribed to them in the
162-
Agreement.
163-
164-
1. Grant of Trademark License. Subject to the terms and conditions
165-
of this Addendum, You grant to the Company a revocable, worldwide,
166-
non-exclusive, non-sublicensable (except for contractors or agents
167-
acting on the Company's behalf, for whose compliance with this
168-
Addendum Company agrees to be responsible), royalty-free, and non-transferable
169-
right to display the Partner Trademarks, solely for the purpose of
170-
marketing and promoting your Contribution (i) on the Company's website
171-
and in any Company in-product integrations page; and (ii) in
172-
marketing, sales, and product materials for Company products.
173-
"Partner Trademarks" mean Your employer's name and any employer
174-
brand features (e.g., logo) you submit to the Company in connection with your
175-
Contribution.
176-
2. Legal authority. You represent that you are legally entitled to
177-
grant the above license. If your employer(s) has rights to
178-
intellectual property in the Partner Trademarks, you represent that
179-
you have received permission to grant the above license on behalf
180-
of that employer, or that your employer has executed a separate
181-
agreement with the Company concerning the subject matter of this
182-
Addendum.
183-
3. Conditions. The license in Section 1 is subject to the following
184-
conditions:
185-
i. The Company shall use the Partner Trademarks in accordance with
186-
any reasonable trademark usage guidelines You provide;
187-
ii. You may revoke this license at any time upon thirty (30) days'
188-
written notice to the Company, after which the Company shall use
189-
commercially reasonable efforts to cease all further public
190-
use of the Partner Trademarks (but may maintain uses in archived
191-
web pages, changelogs, and previously distributed materials).
192-
iii. The Company acknowledges and agrees that it does not own the
193-
Partner Trademarks and that all goodwill derived from the use
194-
of the Partner Trademarks inures solely to benefit of the
195-
Partner Trademarks' owner(s).
196-
iv. The Company shall use the Partner Trademarks in a professional
197-
manner consistent with industry standards and shall not use
198-
them in any way that would reasonably be expected to diminish
199-
their value or harm the reputation of the Partner Trademarks'
200-
owner(s). The Company's use of Partner Trademarks shall not
201-
imply endorsement, sponsorship, or affiliation beyond the
202-
existence of the Contribution in the Company's integration program.
203-
v. The Company will not use the Partner Trademarks in connection
204-
with search engine rankings, ad word purchases, or as part of a
205-
trade name, business name, or Internet domain name.
206-
207-
</details>
208-
209-
**To unblock this PR, reply with exactly:**
210-
211-
\`\`\`
212-
I have read and agree to the Contributor License Agreement Addendum.
213-
CLA-SIGNATURE: ${prAuthor}
214-
\`\`\``;
149+
const claText = `
150+
# Trademark License Addendum
151+
152+
Merging of this pull request is temporarily blocked. Please
153+
read and agree to the Trademark License Addendum below to
154+
unblock merging of this pull request.
155+
156+
<details>
157+
<summary>Click to see Trademark License Addendum</summary>
158+
159+
This Trademark License Addendum ("Addendum") shall, if You have opted
160+
in by replying to the comment that references this Addendum that you
161+
have read and agree to theContributor License Agreement Addendum,
162+
supplement the terms of the Individual Contributor License Agreement
163+
between You and the Company ("Agreement"). Capitalized terms not
164+
defined herein shall have the meanings ascribed to them in the
165+
Agreement.
166+
167+
1. Grant of Trademark License. Subject to the terms and conditions
168+
of this Addendum, You grant to the Company a revocable, worldwide,
169+
non-exclusive, non-sublicensable (except for contractors or agents
170+
acting on the Company's behalf, for whose compliance with this
171+
Addendum Company agrees to be responsible), royalty-free, and non-transferable
172+
right to display the Partner Trademarks, solely for the purpose of
173+
marketing and promoting your Contribution (i) on the Company's website
174+
and in any Company in-product integrations page; and (ii) in marketing, sales,
175+
and product materials for Company products. “Partner Trademarks” mean Your
176+
employer’s name and any employer brand features (e.g., logo) You submit now or
177+
in the future to the Company in connection with your Contributions.
178+
2. Legal authority. You represent that you are legally entitled to
179+
grant the above license. If your employer(s) has rights to
180+
intellectual property in the Partner Trademarks, you represent that
181+
you have received permission to grant the above license on behalf
182+
of that employer, or that your employer has executed a separate
183+
agreement with the Company concerning the subject matter of this
184+
Addendum.
185+
3. Conditions. The license in Section 1 is subject to the following
186+
conditions:
187+
i. The Company shall use the Partner Trademarks in accordance with
188+
any reasonable trademark usage guidelines You provide;
189+
ii. You may revoke this license at any time upon thirty (30) days'
190+
written notice to the Company, after which the Company shall use
191+
commercially reasonable efforts to cease all further public
192+
use of the Partner Trademarks (but may maintain uses in archived
193+
web pages, changelogs, and previously distributed materials).
194+
iii. The Company acknowledges and agrees that it does not own the
195+
Partner Trademarks and that all goodwill derived from the use
196+
of the Partner Trademarks inures solely to benefit of the
197+
Partner Trademarks' owner(s).
198+
iv. The Company shall use the Partner Trademarks in a professional
199+
manner consistent with industry standards and shall not use
200+
them in any way that would reasonably be expected to diminish
201+
their value or harm the reputation of the Partner Trademarks'
202+
owner(s). The Company's use of Partner Trademarks shall not
203+
imply endorsement, sponsorship, or affiliation beyond the
204+
existence of the Contribution in the Company's integration program.
205+
v. The Company will not use the Partner Trademarks in connection
206+
with search engine rankings, ad word purchases, or as part of a
207+
trade name, business name, or Internet domain name.
208+
209+
</details>
210+
211+
**To unblock this PR, reply with exactly:**
212+
213+
\`\`\`
214+
I agree to the Trademark License Addendum
215+
CLA-SIGNATURE: ${prAuthor}
216+
\`\`\`
217+
`;
215218
216219
await github.rest.issues.createComment({
217220
issue_number: prNumber,

0 commit comments

Comments
 (0)