diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml index ff03018..400a6b9 100644 --- a/.github/workflows/cla.yml +++ b/.github/workflows/cla.yml @@ -12,41 +12,11 @@ on: - edited workflow_dispatch: +permissions: + contents: read + pull-requests: read + jobs: CLA: name: CLA - runs-on: ${{ fromJSON(vars.CI_RUNNER_LABELS) }} - permissions: - pull-requests: read - - steps: - - name: Check contributor license status - uses: actions/github-script@v7 - with: - script: | - const pr = context.payload.pull_request; - if (!pr) { - core.notice("CLA check is only meaningful for pull request payloads."); - return; - } - const association = String(pr.author_association || "").toUpperCase(); - const labels = (pr.labels ?? []).map((label) => String(label.name || "").toLowerCase()); - - if (pr.draft) { - core.notice("CLA check skipped for draft pull requests."); - return; - } - - const approvedAssociations = new Set(["MEMBER", "OWNER", "COLLABORATOR"]); - const approvedLabel = labels.includes("cla-approved"); - - if (approvedAssociations.has(association) || approvedLabel) { - core.notice(`CLA check passed for ${pr.user.login} (${association || "UNKNOWN"})`); - return; - } - - core.setFailed([ - "CLA approval is required for external contributions to BioFlow's public core.", - "Ask a maintainer to apply the `cla-approved` label or complete the inbound license workflow in docs/CLA.md.", - "This check passes automatically for repository members, owners, and collaborators." - ].join(" ")); + uses: OmnisGenomics/.github/.github/workflows/cla.yml@main