Skip to content

ci: guard Kilo-only workflows in forks - #11210

Merged
johnnyeric merged 5 commits into
Kilo-Org:mainfrom
maphew:fix/fork-ci-workflow-guards
Jul 16, 2026
Merged

ci: guard Kilo-only workflows in forks#11210
johnnyeric merged 5 commits into
Kilo-Org:mainfrom
maphew:fix/fork-ci-workflow-guards

Conversation

@maphew

@maphew maphew commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add canonical-repo job guards to workflows that depend on Kilo-only secrets, private resources, publishing credentials, CodeQL uploads, or Blacksmith runners.
  • Prevent personal forks from running fork-local CI that cannot succeed outside Kilo-Org/kilocode.
  • Keep upstream PR and canonical-repo CI behavior unchanged.

Why

Forks currently trigger workflows that require Kilo-owned infrastructure or credentials. Those jobs fail or queue indefinitely in forks, creating noisy and unactionable CI failures for fork owners.

Validation

  • bun run script/check-workflows.ts
  • yq eval '.' .github/workflows/*.yml >/dev/null
  • git diff --check
  • Pre-push hook: bun turbo typecheck

gpt-5.5 on behalf of matt

@kilo-code-bot

kilo-code-bot Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Incremental Changes from Previous Review

The latest commit ("ci: trim fork workflow guards") addresses several previous review comments by removing if: github.repository == 'Kilo-Org/kilocode' guards from jobs where they were redundant:

  • Blacksmith runner jobs (check-org-member.yml, docs-build.yml, smoke-test.yml, test-vscode.yml, visual-regression.yml, etc.) — forks cannot use Blacksmith runners, so the runner allocation failure is a sufficient guard.
  • Publish workflow jobs (publish.yml) — triggered by tag pushes and releases, which won't fire in forks.
  • Gate jobs (test.yml, typecheck.yml) — lightweight fan-in jobs that are harmless to run in forks.

Guards were retained (or strengthened with workflow_dispatch allowance) on:

  • codeql.yml / codeql-kotlin.yml — CodeQL uploads require security-events: write.
  • containers.yml — container image builds require Kilo infrastructure.
  • auto-docs.yml — the PR merge path still requires the repo check; workflow_dispatch is ungated.
  • watch-opencode-releases.yml — config var + repo check.

Other changes:

  • script/publish.ts refactored inline release-note logic into script/kilocode/release-notes.ts with tests.
  • script/upstream/utils/config.ts added new upstream files to the merge skip list.
Files Reviewed (19 files + incremental)

Carried forward from previous review:

  • .github/workflows/auto-docs.yml
  • .github/workflows/check-org-member.yml
  • .github/workflows/codeql-kotlin.yml
  • .github/workflows/codeql.yml
  • .github/workflows/containers.yml
  • .github/workflows/docs-build.yml
  • .github/workflows/duplicate-issues.yml
  • .github/workflows/publish.yml
  • .github/workflows/smoke-test.yml
  • .github/workflows/test-vscode.yml
  • .github/workflows/test.yml
  • .github/workflows/typecheck.yml
  • .github/workflows/visual-regression.yml
  • .github/workflows/watch-opencode-releases.yml

New/changed since previous review:

  • script/publish.ts — refactored release notes
  • script/kilocode/release-notes.ts — new, extracted logic
  • script/kilocode/release-notes.test.ts — new tests
  • script/check-opencode-promise-facades.ts — allowlist maintenance
  • script/upstream/utils/config.ts — merge skip list additions
Previous Review Summaries (2 snapshots, latest commit fadfa6f)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit fadfa6f)

Status: No Issues Found | Recommendation: Merge

Incremental Changes from Previous Review

The latest commit ("ci: trim fork workflow guards") addresses several previous review comments by removing if: github.repository == 'Kilo-Org/kilocode' guards from jobs where they were redundant:

  • Blacksmith runner jobs (check-org-member.yml, docs-build.yml, smoke-test.yml, test-vscode.yml, visual-regression.yml, etc.) — forks cannot use Blacksmith runners, so the runner allocation failure is a sufficient guard.
  • Publish workflow jobs (publish.yml) — triggered by tag pushes and releases, which won't fire in forks.
  • Gate jobs (test.yml, typecheck.yml) — lightweight fan-in jobs that are harmless to run in forks.

Guards were retained (or strengthened with workflow_dispatch allowance) on:

  • codeql.yml / codeql-kotlin.yml — CodeQL uploads require security-events: write.
  • containers.yml — container image builds require Kilo infrastructure.
  • auto-docs.yml — the PR merge path still requires the repo check; workflow_dispatch is ungated.
  • watch-opencode-releases.yml — config var + repo check.

Other changes:

  • script/publish.ts refactored inline release-note logic into script/kilocode/release-notes.ts with tests.
  • script/upstream/utils/config.ts added new upstream files to the merge skip list.
Files Reviewed (19 files + incremental)

Carried forward from previous review:

  • .github/workflows/auto-docs.yml
  • .github/workflows/check-org-member.yml
  • .github/workflows/codeql-kotlin.yml
  • .github/workflows/codeql.yml
  • .github/workflows/containers.yml
  • .github/workflows/docs-build.yml
  • .github/workflows/duplicate-issues.yml
  • .github/workflows/publish.yml
  • .github/workflows/smoke-test.yml
  • .github/workflows/test-vscode.yml
  • .github/workflows/test.yml
  • .github/workflows/typecheck.yml
  • .github/workflows/visual-regression.yml
  • .github/workflows/watch-opencode-releases.yml

New/changed since previous review:

  • script/publish.ts — refactored release notes
  • script/kilocode/release-notes.ts — new, extracted logic
  • script/kilocode/release-notes.test.ts — new tests
  • script/check-opencode-promise-facades.ts — allowlist maintenance
  • script/upstream/utils/config.ts — merge skip list additions

Previous review (commit e1e2420)

Status: No Issues Found | Recommendation: Merge

This PR correctly adds github.repository == 'Kilo-Org/kilocode' guards to workflow jobs that depend on Kilo-owned infrastructure, secrets, or Blacksmith runners. The approach is standard and consistent across all modified files.

A few notes on the implementation quality:

  • The required gate jobs in test.yml and typecheck.yml correctly combine the repo guard with always(), preserving the existing fan-in behavior in the canonical repo while skipping cleanly in forks.
  • The check-org-member.yml guard is harmless — it's a workflow_call reusable workflow, and github.repository resolves to the caller's repo at runtime, so the guard works correctly for callers too.
  • The auto-docs.yml multi-line if expression correctly wraps the existing OR condition in parentheses after prepending the AND clause.
  • The duplicate-issues.yml recheck-compliance guard is correct; the check-duplicates job remains unconditionally disabled (if: false) and is unaffected.
  • The visual-regression.yml downstream jobs correctly AND the repo guard with the needs.check-paths.outputs.matched == 'true' condition.
Files Reviewed (14 files)
  • .github/workflows/auto-docs.yml
  • .github/workflows/check-org-member.yml
  • .github/workflows/codeql-kotlin.yml
  • .github/workflows/codeql.yml
  • .github/workflows/containers.yml
  • .github/workflows/docs-build.yml
  • .github/workflows/duplicate-issues.yml
  • .github/workflows/publish.yml
  • .github/workflows/smoke-test.yml
  • .github/workflows/test-vscode.yml
  • .github/workflows/test.yml
  • .github/workflows/typecheck.yml
  • .github/workflows/visual-regression.yml
  • .github/workflows/watch-opencode-releases.yml

Reviewed by gpt-5.6-sol · Input: 89.4K · Output: 9K · Cached: 386.6K

Review guidance: REVIEW.md from base branch main

@maphew

maphew commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

Local Review for branch diff: fix/fork-ci-workflow-guards -> origin/main

Summary

This change adds canonical repository guards to workflow jobs that rely on Kilo-owned CI infrastructure, secrets, publishing permissions, private resources, or CodeQL uploads. I found no high-confidence security, performance, business logic, deploy safety, duplication, or dead-code issues in the reviewed diff.

Issues Found

No issues found.

Detailed Findings

No detailed findings.

Recommendation

APPROVE — Code is ready to merge/commit

gpt-5.5 on behalf of matt

@maphew
maphew force-pushed the fix/fork-ci-workflow-guards branch from 2067c24 to e1e2420 Compare June 14, 2026 04:17
@johnnyeric
johnnyeric requested review from catrielmuller and markijbema and removed request for catrielmuller June 15, 2026 10:07
Comment thread .github/workflows/check-org-member.yml Outdated
Comment thread .github/workflows/duplicate-issues.yml Outdated
Comment thread .github/workflows/docs-build.yml Outdated
jobs:
build:
name: Build docs site
if: github.repository == 'Kilo-Org/kilocode' # kilocode_change

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't fully get it, why does this need to be disabled?

Comment thread .github/workflows/smoke-test.yml Outdated
Comment thread .github/workflows/test-vscode.yml Outdated

@markijbema markijbema left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! Thanks for the PR: love that you picked it up broadly to make the contributor experience better.

However I stopped reviewing halfway because i think this is to overeager. I do agree it's a good idea to disable all jobs which are more infrastructural, but we dont need to disable jobs which are

  1. only manually invoked
  2. core test infrastructure (if this fails on forks we should look into that instead imho)

Can you please trim it down to only the infrastructure/autotriggered jobs?

@maphew

maphew commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the review feedback in fadfa6f: trimmed the fork repository guards down to infrastructure/autotriggered workflows, left manual-only and core test workflows runnable, and kept workflow_dispatch paths available on forks where applicable.\n\nValidation run locally:\n- bun run script/check-workflows.ts\n- bun run script/check-opencode-annotations.ts\n- git diff --check

@johnnyeric

Copy link
Copy Markdown
Contributor

Hey @maphew, thanks for addressing the comments. Could you please resolve the conflict?

@maphew
maphew force-pushed the fix/fork-ci-workflow-guards branch from b280aaa to f225118 Compare July 14, 2026 17:14
@maphew
maphew requested a review from markijbema July 15, 2026 20:07
@johnnyeric
johnnyeric merged commit 0b5ad0f into Kilo-Org:main Jul 16, 2026
28 checks passed
@johnnyeric

Copy link
Copy Markdown
Contributor

Thanks for improving this. Just merged.

t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
* ci: guard Kilo-only workflows in forks

* ci: trim fork workflow guards

---------

Co-authored-by: CI Bot <ci@beads.test>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants