This directory contains reusable GitHub Actions workflows that can be used across all Knitli repositories.
Checks if PR contributors have signed the CLA and stores signatures centrally.
Usage in your repository:
# .github/workflows/cla.yml
name: CLA Assistant
on:
issue_comment:
types: [created]
pull_request_target:
types: [opened, closed, synchronize]
jobs:
cla-check:
uses: knitli/.github/.github/workflows/cla-check.yml@main
with:
repo_name: "your-repo-name" # e.g., "codeweaver", "thread"
cla_document_url: "https://github.com/knitli/your-repo/blob/main/CONTRIBUTORS_LICENSE_AGREEMENT.md"
secrets: inheritInputs:
repo_name(required): Repository name for signature file (e.g., "codeweaver")cla_document_url(optional): URL to CLA document (defaults to repo'sCONTRIBUTORS_LICENSE_AGREEMENT.md)branch(optional): Branch for storing signatures (default: "main")
Secrets:
CLA_ACCESS_TOKEN: Organization-level secret with write access toknitli/.githubrepo
Features:
- Checks org membership automatically - org members are exempt from CLA
- Automatically exempts bots and automation accounts (e.g.,
claude,copilot,dependabot) - Posts clear success message when all contributors are exempt
- Stores signatures in
knitli/.github/cla-signatures/{repo_name}.json - Friendly PR comments with clear instructions for non-exempt contributors
Examples:
When creating new reusable workflows:
-
Use
workflow_calltrigger:on: workflow_call: inputs: # Define inputs here secrets: # Define required secrets
-
Add SPDX headers for licensing compliance
-
Document inputs and usage in this README
-
Test thoroughly before using in production repos
-
Version with tags for stability (optional):
uses: knitli/.github/.github/workflows/[email protected]
- ✅ Single source of truth: Update logic once, applies everywhere
- ✅ Consistency: All repos use identical, tested workflows
- ✅ Maintainability: Easier to fix bugs and add features
- ✅ DRY principle: Don't repeat workflow code across repos
If organization members are routinely being told they need to sign the CLA, there is an authentication issue with the CLA_ACCESS_TOKEN preventing the action from accurately retrieving organization membership.
Root Causes:
- The
CLA_ACCESS_TOKEN(a Personal Access Token) lacks theread:orgscope required to check organization membership. - The Knitli organization enforces SAML Single Sign-On (SSO), and the
CLA_ACCESS_TOKENhas not been explicitly authorized for SSO. Without SSO authorization, the GitHub API returns302/403/404errors for organization membership checks, even if the token owner is an admin.
How to Fix:
- Go to your GitHub Settings -> Developer settings -> Personal access tokens (classic).
- Generate a new token with the
read:organdreposcopes (or update the existing one). - Crucial Step: Next to your token, click "Configure SSO" and authorize it for the Knitli organization.
- Update the
CLA_ACCESS_TOKENorganization secret with this new, authorized token value.