mirror of
https://github.com/tiennm99/open-domains.git
synced 2026-10-13 14:16:17 +00:00
Update cla.yml
This commit is contained in:
1 parent
dbbe83fdb6
commit
e280108dbb
1 file changed
+27
-37
+27
-37
@@ -17,10 +17,7 @@ jobs:
|
||||
|
||||
- name: "CLA Assistant"
|
||||
id: cla_assistant_step
|
||||
if: >
|
||||
(github.event_name == 'issue_comment' && contains(github.event.comment.body || '', 'recheck')) ||
|
||||
(github.event_name == 'issue_comment' && contains(github.event.comment.body || '', 'I have read the CLA Document and I hereby sign the CLA')) ||
|
||||
github.event_name == 'pull_request_target'
|
||||
if: (github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
|
||||
uses: contributor-assistant/github-action@v2.6.1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.create_token.outputs.token }}
|
||||
@@ -33,56 +30,49 @@ jobs:
|
||||
remote-organization-name: 'open-domains'
|
||||
remote-repository-name: 'cla'
|
||||
lock-pullrequest-aftermerge: false
|
||||
|
||||
|
||||
- name: Re-run CLA Check if "recheck"
|
||||
if: >
|
||||
github.event_name == 'issue_comment' && contains(github.event.comment.body || '', 'recheck')
|
||||
if: github.event.comment.body == 'recheck'
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const octokit = github.getOctokit(process.env.GITHUB_TOKEN)
|
||||
const { data: checkRuns } = await octokit.rest.checks.listForRef({
|
||||
script: |
|
||||
const octokit = github.getOctokit(process.env.GITHUB_TOKEN)
|
||||
const { data: checkRuns } = await octokit.rest.checks.listForRef({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
ref: context.sha,
|
||||
check_name: 'CLA / CLAAssistant (pull_request_target)'
|
||||
});
|
||||
if(checkRuns.total_count > 0){
|
||||
const checkRunId = checkRuns.check_runs[0].id;
|
||||
await octokit.rest.checks.rerequestCheckRun({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
ref: context.sha,
|
||||
check_name: 'CLA / CLAAssistant (pull_request_target)'
|
||||
check_run_id: checkRunId
|
||||
});
|
||||
if(checkRuns.total_count > 0){
|
||||
const checkRunId = checkRuns.check_runs[0].id;
|
||||
await octokit.rest.checks.rerequestCheckRun({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
check_run_id: checkRunId
|
||||
});
|
||||
console.log("CLA check re-run has been triggered")
|
||||
} else {
|
||||
console.log("CLA check not found")
|
||||
}
|
||||
console.log("CLA check re-run has been triggered")
|
||||
} else {
|
||||
console.log("CLA check not found")
|
||||
}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Add CLA Signed
|
||||
- name: add CLA signed
|
||||
uses: actions-ecosystem/action-add-labels@v1
|
||||
if: >
|
||||
(github.event_name == 'issue_comment' && contains(github.event.comment.body || '', 'recheck')) ||
|
||||
(github.event_name == 'issue_comment' && contains(github.event.comment.body || '', 'I have read the CLA Document and I hereby sign the CLA')) ||
|
||||
github.event_name == 'pull_request_target'
|
||||
if: (github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
|
||||
with:
|
||||
labels: "CLA Signed"
|
||||
github_token: ${{ steps.create_token.outputs.token }}
|
||||
|
||||
- name: Remove CLA Required
|
||||
- name: remove CLA required
|
||||
uses: actions-ecosystem/action-remove-labels@v1
|
||||
if: >
|
||||
(github.event_name == 'issue_comment' && contains(github.event.comment.body || '', 'recheck')) ||
|
||||
(github.event_name == 'issue_comment' && contains(github.event.comment.body || '', 'I have read the CLA Document and I hereby sign the CLA')) ||
|
||||
github.event_name == 'pull_request_target'
|
||||
if: (github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
|
||||
with:
|
||||
labels: "CLA Required"
|
||||
github_token: ${{ steps.create_token.outputs.token }}
|
||||
github_token: ${{ steps.create_token.outputs.token }}
|
||||
|
||||
- name: Add CLA Required on Failure
|
||||
if: ${{ failure() }}
|
||||
- if: ${{ failure() }}
|
||||
name: Add CLA required
|
||||
uses: actions-ecosystem/action-add-labels@v1
|
||||
with:
|
||||
labels: "CLA Required"
|
||||
|
||||
Reference in new issue
Block a user