Skip to content

Commit af08baa

Browse files
committed
fix_workflow_2
1 parent 0bd57d2 commit af08baa

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ permissions: write-all
1717
jobs:
1818
process-cla-approval:
1919
runs-on: ubuntu-latest
20-
if: github.event_name == 'workflow_dispatch' || github.event_name == 'issue_comment' || (github.event_name == 'pull_request_target' && github.event.label.name == 'cla-signed' && github.actor != 'workflow-authentication-public[bot]')
20+
if: github.event_name == 'workflow_dispatch' || github.event.label.name == 'cla-signed' || github.event_name == 'issue_comment'
2121

2222
steps:
2323

@@ -41,6 +41,12 @@ jobs:
4141
with:
4242
github-token: ${{ steps.generate-token.outputs.token || secrets.GITHUB_TOKEN }}
4343
script: |
44+
// Exit early if this is the bot adding labels to prevent double execution
45+
if (context.actor.includes('workflow-authentication-public')) {
46+
console.log(`Skipping execution for bot actor: ${context.actor}`);
47+
return;
48+
}
49+
4450
let prNumber;
4551
let approvedBy;
4652
let prAuthor;
@@ -272,7 +278,7 @@ jobs:
272278
PR_NUMBER="${{ steps.process-cla-approval.outputs.pr_number }}"
273279
APPROVED_BY="${{ steps.process-cla-approval.outputs.approved_by }}"
274280
275-
echo "Recording manual CLA approval:"
281+
echo "Recording manual trademark addendum approval:"
276282
echo " Username: $USERNAME"
277283
echo " PR Number: $PR_NUMBER"
278284
echo " Approved by: $APPROVED_BY"
@@ -294,7 +300,7 @@ jobs:
294300
"approved_by": $approved_by
295301
}]' cla-signatures.json > tmp.json && mv tmp.json cla-signatures.json
296302
297-
echo "New CLA approval signature added"
303+
echo "New trademark adendum signature added"
298304
else
299305
echo "Signature already exists for this user and PR"
300306
fi
@@ -303,7 +309,7 @@ jobs:
303309
git config user.name "github-actions[bot]"
304310
git config user.email "github-actions[bot]@users.noreply.github.com"
305311
git add cla-signatures.json
306-
git commit -m "Add manual CLA approval for @$USERNAME (PR #$PR_NUMBER) by @$APPROVED_BY" || echo "No changes to commit"
312+
git commit -m "Add manual approval for @$USERNAME (PR #$PR_NUMBER) by @$APPROVED_BY" || echo "No changes to commit"
307313
git push
308314
309-
echo "Manual CLA approval recorded successfully"
315+
echo "Manual trademark addendum approval recorded successfully"

0 commit comments

Comments
 (0)