Skip to content
Merged
Show file tree
Hide file tree
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
18 changes: 18 additions & 0 deletions .github/workflows/cla-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CLA trigger

on:
pull_request:
types: [opened, reopened, synchronize]

permissions: {}

jobs:
# Its completion starts the CLA workflow, which checks the pull request with the signature App.
# Not named `cla`, since a check with that name would satisfy the required `cla` status, except
# on Dependabot's own runs: the CLA workflow skips those, and its PRs need no signature.
trigger:
name: ${{ github.actor == 'dependabot[bot]' && 'cla' || 'trigger' }}
runs-on: ubuntu-24.04
timeout-minutes: 1
steps:
- run: echo "The CLA workflow checks this pull request when this run completes."
26 changes: 15 additions & 11 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
name: CLA

on:
workflow_run:
workflows: [CLA trigger]
types: [completed]
issue_comment:
types: [created]
pull_request_target:
types: [opened, reopened, synchronize]

permissions: {}

jobs:
cla:
# Dependabot-triggered runs cannot access the App secret; human updates and rechecks still run.
# Reports a `cla` commit status on the pull request's head; this job's own check lands on main.
check:
if: |
github.actor != 'dependabot[bot]' &&
(github.event_name == 'pull_request_target' ||
(github.event_name == 'issue_comment' && github.event.issue.pull_request &&
github.event.comment.user.type != 'Bot' &&
(contains(github.event.comment.body, 'CLA') || contains(github.event.comment.body, 'recheck'))))
(github.event_name == 'workflow_run' && github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.actor.login != 'dependabot[bot]') ||
(github.event_name == 'issue_comment' && github.event.issue.pull_request &&
github.event.comment.user.type != 'Bot' &&
(contains(github.event.comment.body, 'CLA') || contains(github.event.comment.body, 'recheck')))
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions:
actions: write
contents: read
pull-requests: write
statuses: write
steps:
# This privileged workflow must never check out or execute pull-request code.
- name: Create signature writer token
Expand All @@ -34,11 +35,14 @@ jobs:
owner: ${{ github.repository_owner }}
repositories: ${{ github.event.repository.name }}
permission-single-file: write
- uses: openwatersio/cla-github-action@599be7e585704b7eb53be7498aebefc0e7d8caac # Open Waters fork
- uses: openwatersio/cla-github-action@f07dfd38224fde9ace8e7b8437ba318e0db042ea # Open Waters fork
env:
GITHUB_TOKEN: ${{ github.token }}
PERSONAL_ACCESS_TOKEN: ${{ steps.cla-token.outputs.token }}
with:
# The open pull request whose head is this commit is checked; nothing from the triggering run is trusted.
head-sha: ${{ github.event.workflow_run.head_sha }}
status-context: cla
path-to-document: "https://github.com/${{ github.repository }}/blob/main/CLA.md"
path-to-signatures: ".cla.json"
branch: "main"
Expand Down
4 changes: 2 additions & 2 deletions docs/licensing.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ Signal (AGPLv3) uses this exact approach to distribute on the iOS App Store. The

The CLA workflow records signatures in `.cla.json` on `main` using the organization-owned Open Waters CLA App. The App has Single file write permission for `.cla.json` and Metadata read permission. It needs a bypass in any ruleset that would reject its signature commits; the ordinary GitHub Actions token does not need a bypass.

Maintainers configure the organization variable `CLA_APP_CLIENT_ID` and encrypted Actions secret `CLA_APP_PRIVATE_KEY`, restricted to the participating repositories. The workflow creates a short-lived token scoped to this repository. Never check out or execute pull-request code in this privileged workflow. See the [shared setup guide](https://github.com/openwatersio/cla-github-action/blob/master/docs/open-waters.md).
Maintainers configure the organization variable `CLA_APP_CLIENT_ID` and encrypted Actions secret `CLA_APP_PRIVATE_KEY`, restricted to the participating repositories. The workflow creates a short-lived token scoped to this repository. Never check out or execute pull-request code in the privileged CLA workflow. See the [shared setup guide](https://github.com/openwatersio/cla-github-action/blob/master/docs/open-waters.md).

Human comments mentioning the CLA or `recheck` reach the action's signing-text validation. Dependabot-initiated runs are skipped because Actions secrets are unavailable; human updates and recheck comments still run. Claude co-author metadata is exempt, while human contributors must sign. If storage rejects a write, the check fails; comment `recheck` to retry. The workflow result and `.cla.json` are authoritative even if a bot comment has already acknowledged signing.
Each pull request runs the secret-free `CLA trigger` workflow. When it completes, the CLA workflow runs from `main`, checks the open pull request whose head is that commit, and sets a `cla` commit status on it. Human comments mentioning the CLA or `recheck` reach the action's signing-text validation and update the status. Claude co-author metadata is exempt, while human contributors must sign. If storage rejects a write, the `cla` status reports an error; comment `recheck` to retry. The `cla` status and `.cla.json` are authoritative even if a bot comment has already acknowledged signing. An unsigned result shows only in the status, not as a failed CLA workflow run.

## References

Expand Down
Loading