Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 5 additions & 35 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading