Skip to content

ci: guard privileged workflows so they cannot run in forks #6248

Open

Description

@maphew

What

Kilo Cloud workflows have no canonical-repo guard, so a fork with Actions enabled will attempt to run them. Kilo-Org/kilocode has had the rule if: github.repository == 'Kilo-Org/kilocode' on its non-test workflows for a long time; Kilo Cloud never picked it up.

Why it matters

  • Privileged workflows are reachable from a fork. deploy-production.yml, deploy-staging.yml, deploy-workers.yml, deploy-kiloclaw.yml, kilo-app-release.yml, extension-store-release.yml, redeploy-web.yml, and push-dev-kiloclaw.yml fail on missing repo secrets/vars when run outside Kilo-Org/cloud. Deploy/release actions should be unreachable outside the canonical repo, not merely fail on a missing secret.
  • Scheduled/push automation fires in forks too. auto-docs.yml, bump-openclaw.yml, sbom.yml, setup-smoke.yml, and stale-prs.yaml act on shared state (webhooks, issue comments, PR closes) that only makes sense for the canonical repo.
  • Noise. Contributors see failures in their fork that have nothing to do with their change.

For example, on 2026-09-16 run 35139264761 — a fork PR branch whose merge touched .github/workflows/* — failed with "This run likely failed because of a workflow file issue", and the fork's push/scheduled workflows would attempt the same privileged jobs.

Proposal

Mirror the kilocode rule: add if: github.repository == 'Kilo-Org/cloud' to the jobs of the workflows that must only run in the canonical repository, combined with any existing if condition.

Guarded: auto-docs, bump-openclaw, check-md-table-padding, codeql, deploy-production, deploy-staging, deploy-workers, deploy-kiloclaw, extension-store-release, kilo-app-release, promote-vercel-deployment, push-dev-kiloclaw, redeploy-web, sbom, setup-smoke, stage-vercel-deployment, stale-prs.

Intentionally not guarded: the pull-request validation workflows (ci.yml, extension-ci.yml, kilo-app-ci.yml, mobile-native-build.yml, chromatic.yml, trufflehog.yml). For pull_request events github.repository is the base repo, so a guard there is a no-op for normal CI and would only turn an approved fork-PR run into a wall of skipped jobs. This matches kilocode, which does not guard its test/typecheck workflows.

Not addressed here

Every fork PR also produces action_required runs. That is GitHub's repo setting Settings → Actions → General → Fork pull request workflows (approval required before fork workflows run) and cannot be suppressed from workflow code. If the intent is to stop those runs entirely rather than keep them approval-gated, it needs a settings change by a maintainer — e.g. restricting approval to first-time contributors.

A PR implementing the guard is coming.

Activity

  1. added 11 commits that reference this issue on Sep 18, 2026
    86915a4
    02b1ba5
    3799c61
    85129e9
    4936bea
    4e0a0c4
    5729a8d
    c57675d
    c8853be
    5657d7e
    1d8ec82
  2. maphew commented on Oct 13, 2026

    @maphew
    ContributorAuthor

    can we please fix this? this is a demotivating way to start the week every week:

    Image ... Image
  3. added 4 commits that reference this issue on Oct 13, 2026
    5324abf
    6448f47
    37f69c0
    daf71c2
  4. maphew commented on Oct 23, 2026

    @maphew
    ContributorAuthor

    Status update for #6786: it is open, mergeable, and all review threads are now addressed and resolved. Latest commit 9c62fb6:

    • restored inputs.base_sha != '' in deploy-workers.yml after confirming the staging caller passes base_sha
    • guarded the last three deploy-production.yml jobs so the file matches the "every job" comment
    • corrected the job count in the PR description

    What is left is outside the author's control: required CI has not run and the PR is blocked on review. Fork PR workflows need a maintainer to approve the run, and the PR needs one approving review. Recent committers to .github/workflows: @iscekic @eshurakov @pandemicsyn — could one of you take a look?

    For context, in the last seven days the fork ran kilo-app Release (hourly, fails on the missing EXPO_TOKEN), Setup Smoke (hourly, queues on an unavailable 8-core runner and gets cancelled), and the OpenClaw check (12-hourly): 81 failed or cancelled runs. This change stops those workflows from running in forks. It does not affect the action_required gate on fork PRs, which is the separate Fork pull request workflows setting.

    kilo-kilo-auto/efficient-unknown-reasoning on behalf of matt wilkie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions