Skip to content

Commit 98ce608

Browse files
committed
fix(ci): CLA workflow
1 parent 05f932a commit 98ce608

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

.github/workflows/cla.yml

+16-10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: "CLA"
22
on:
3+
pull_request_target:
4+
types: [opened, reopened]
35
issue_comment:
46
types: [created]
5-
pull_request_target:
6-
types: [opened,closed,synchronize]
77

88
jobs:
99
CLAAssistant:
@@ -14,19 +14,19 @@ jobs:
1414
with:
1515
app_id: ${{ secrets.APP_ID }}
1616
private_key: ${{ secrets.PRIVATE_KEY }}
17-
17+
1818
- name: "CLA Assistant"
19-
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
20-
# Beta Release
19+
if: >-
20+
github.event_name == 'pull_request_target' ||
21+
(github.event_name == 'issue_comment' && github.event.issue.pull_request &&
22+
(github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA'))
2123
uses: contributor-assistant/[email protected]
2224
env:
2325
GITHUB_TOKEN: ${{ steps.create_token.outputs.token }}
24-
# the below token should have repo scope and must be manually added by you in the repository's secret
2526
PERSONAL_ACCESS_TOKEN: ${{ steps.create_token.outputs.token }}
2627
with:
2728
path-to-signatures: 'signatures-v3.json'
28-
path-to-document: 'https://github.com/open-domains/register/blob/main/terms.md' # e.g. a CLA or a DCO document
29-
# branch should not be protected
29+
path-to-document: 'https://github.com/open-domains/register/blob/main/terms.md'
3030
branch: 'main'
3131
allowlist: od-bot,bot*,kyro3400
3232
remote-organization-name: 'open-domains'
@@ -35,14 +35,20 @@ jobs:
3535

3636
- name: add CLA signed
3737
uses: actions-ecosystem/action-add-labels@v1
38-
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
38+
if: >-
39+
github.event_name == 'pull_request_target' ||
40+
(github.event_name == 'issue_comment' && github.event.issue.pull_request &&
41+
(github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA'))
3942
with:
4043
labels: "CLA Signed"
4144
github_token: ${{ steps.create_token.outputs.token }}
4245

4346
- name: remove CLA required
4447
uses: actions-ecosystem/action-remove-labels@v1
45-
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
48+
if: >-
49+
github.event_name == 'pull_request_target' ||
50+
(github.event_name == 'issue_comment' && github.event.issue.pull_request &&
51+
(github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA'))
4652
with:
4753
labels: "CLA Required"
4854
github_token: ${{ steps.create_token.outputs.token }}

0 commit comments

Comments
 (0)