Skip to content

chore(cla): call the shared CLA reusable instead of a self-hosted job (ENG-2017) - #5

Merged
lucas-koontz merged 2 commits into
mainfrom
chore/eng-2017-cla-off-self-hosted-runner
Aug 27, 2026
Merged

lucas-koontz merged 2 commits into
mainfrom
chore/eng-2017-cla-off-self-hosted-runner

Conversation

@lucas-koontz

@lucas-koontz lucas-koontz commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

User story

As a maintainer of this repository
I want the CLA check to run on a disposable GitHub-hosted runner
So that a stranger opening a pull request cannot start a pod inside our clusters

Why this matters

cla.yml ran on mdb-dev, which is not a GitHub VM. It is a pod inside our newdev
EKS cluster, holding a Kubernetes identity, an AWS role and a filesystem other
repositories' credentialed jobs write into.

This workflow triggers on pull_request_target and issue_comment. Both run in
base-repo context, so GitHub's fork-approval gate never applies: the run starts
when a pull request opens or a comment is posted, from any account, with nobody
clicking anything. Outside accounts have already done it here.

The job also ran contributor-assistant/github-action@v2.6.1, a mutable tag, so
whoever controls that tag upstream chose what ran on the pod.

What happens today

flowchart TD
    S["Any GitHub account"] --> E["Opens a PR, or comments on any issue"]
    E --> N["Base-repo trigger, so no approval gate applies"]
    N --> J["Job claims a pod on mdb-dev"]
    J --> P["Four write scopes on GITHUB_TOKEN"]
    J --> A["Third-party action on a mutable tag"]
Loading

What should happen

flowchart TD
    S["Any GitHub account"] --> E["Opens a PR, or comments on any issue"]
    E --> G{"Job condition: a PR event, or a CLA comment?"}
    G -->|"no, an unrelated comment"| SKIP["Job skipped, no runner claimed"]
    G -->|"yes"| J["Job runs on ubuntu-latest"]
    J --> A["Action pinned to a commit SHA"]
Loading

Acceptance criteria

  • The CLA job no longer requests mdb-dev.
  • An issue_comment that is not a CLA comment leaves the job skipped, with no runner claimed.
  • A pull request still gets the check, so an unsigned author is asked to sign.
  • Negative: the existing signature ledger is untouched and still readable.

How to test

  1. Open a pull request from a fork using an account that is not in the allowlist. The CLA job runs on a GitHub-hosted runner and the bot comments asking for a signature.
  2. Comment the signature phrase. The re-check passes and the signature lands on the cla branch.
  3. Comment something unrelated on any open issue. The CLA workflow shows the job as skipped and claims no runner.

Notes for the reviewer

The green CLAssistant row on this pull request does not exercise this change. pull_request_target loads the workflow from the base branch, so the check that passed here is the copy this PR replaces, running on mdb-dev. The new job cannot test itself on its own pull request; it is exercised on the first pull request opened after this merges.

This replaces a hand-rolled job with the reusable anton, cowork and cowork-server already call. Nothing new was invented. The reusable is hardened in the same change set at mindsdb/github-actions, which pins the action to a commit, moves the event filter from the step to the job, drops its runs-on input entirely, and reduces actions: write to actions: read.

The actions scope is read, not write, and that is deliberate. The upstream README asks for write. The only write it buys is pullRerunRunner.ts re-running a previously failed CLA run, and that API refuses a GITHUB_TOKEN, so the call already failed and was swallowed. Dropping the scope altogether does break the job, because the same file lists the repository's workflows first and main.ts turns any throw into a failure.

The signature ledger is untouched. path-to-signatures and branch still resolve to the same file on the same branch, so every existing signature stays where it is.

The agreement link names the canonical repository rather than a redirect. Every URL the org used for this document was a rename redirect. They all resolve to the same file and serve byte-identical content, so nothing changes for a reader today. A redirect stops being harmless the moment somebody creates a repository at the old name, and this is the page a contributor reads before agreeing to it.

Verified locally

Check What I observed
actionlint on the changed file Clean, v1.7.12. This repo runs no workflow linter of its own, so I ran the version the org's shared lint workflow pins.
The reusable's runner default Read from mindsdb/github-actions@main: runs-on: ubuntu-latest, and after this change set the input does not exist at all.
Nothing else reads the removed input gh search code over the org: anton, cowork and cowork-server call the reusable and none of them passes runs-on.
The existing ledger Still resolves on the cla branch, 1 signer, unchanged by this PR.

Ships with

One behaviour across eleven repositories, one pull request each. The anchor is
mindsdb/github-actions, which hardens the shared reusable this file now calls.
There is no Deploys: line and no pull request environment: these are library
repositories with no deploy pipeline, so nothing here brings up an environment.

Merge order: the anchor first, and that is a requirement rather than a
preference.
This wrapper grants actions: read, and until
mindsdb/github-actions#55 merges the reusable still declares actions: write.
A called workflow's permissions are enforced when its file is loaded, so a
callee naming a scope its caller has not granted rejects the whole run as a
startup_failure with zero jobs, and there is no job left to report it. The
run is red, the CLA gate is down, and nothing announces either.

Refs: ENG-2017

… (ENG-2017)

The CLA check ran on mdb-dev, a pod inside the newdev cluster. Its triggers,
pull_request_target and issue_comment, both run in base-repo context, so
GitHub's fork-approval gate never applied and any account could start that pod
by opening a pull request or leaving a comment.

Replace the hand-rolled job with the reusable anton, cowork and cowork-server
already call. It runs on ubuntu-latest, pins the third-party action to a commit,
grants actions read rather than write, and skips the job outright for a comment
that is not a CLA comment.

Refs: ENG-2017
…017)

Both URLs the org uses for this document are rename redirects that resolve to
the same repository and serve byte-identical content. A redirect is fine until
somebody creates a repository at the old name, and this is the page a
contributor reads before agreeing to it. Name the repository that actually
holds the file.

Refs: ENG-2017
@lucas-koontz
lucas-koontz merged commit 6a03910 into main Aug 27, 2026
5 checks passed
@lucas-koontz
lucas-koontz deleted the chore/eng-2017-cla-off-self-hosted-runner branch August 27, 2026 23:56
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 27, 2026
@lucas-koontz lucas-koontz self-assigned this Aug 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants