From 5d0d810d67c235dc8dca46766cbd824c1d756d5d Mon Sep 17 00:00:00 2001 From: DIBSTER <76603072+DEV-DIBSTER@users.noreply.github.com> Date: Thu, 26 Dec 2024 17:38:04 -0500 Subject: [PATCH] Update cla.yml --- .github/workflows/cla.yml | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml index cfd557d5..4b2c4e5d 100644 --- a/.github/workflows/cla.yml +++ b/.github/workflows/cla.yml @@ -16,6 +16,7 @@ jobs: private_key: ${{ secrets.PRIVATE_KEY }} - 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')) || @@ -28,11 +29,38 @@ jobs: path-to-signatures: 'signatures-v3.json' path-to-document: 'https://github.com/open-domains/register/blob/main/terms.md' branch: 'main' - allowlist: od-bot,bot*,kyro3400 + allowlist: od-bot,bot* 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') + uses: actions/github-script@v6 + with: + 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, + check_run_id: checkRunId + }); + console.log("CLA check re-run has been triggered") + }else{ + console.log("CLA check not found") + } + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Add CLA Signed uses: actions-ecosystem/action-add-labels@v1 if: > @@ -46,7 +74,7 @@ jobs: - 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 || '', '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' with: