Skip to content

fix(ci): read private cloud PRs in docs-sync via a GitHub App token - #13081

Open
RSO wants to merge 1 commit into
mainfrom
fix/docs-sync-app-token
Open

fix(ci): read private cloud PRs in docs-sync via a GitHub App token#13081
RSO wants to merge 1 commit into
mainfrom
fix/docs-sync-app-token

Conversation

@RSO

@RSO RSO commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

What

docs-sync now mints a read-only GitHub App installation token for the Collect merged PRs step, instead of using github.token for it.

Why

collect.mjs is the only place that crosses repo boundaries. It needs exactly three reads on each source repo: GET /search/issues, GET /repos/…/pulls/{n}, and GET /repos/…/pulls/{n}/files — all covered by Pull requests: read.

Follow-ups worth deciding separately

  • The per-repo loop in collect.mjs should degrade like the per-PR fetches already do, so a future access regression doesn't block the whole bot.

Kilo-Org/cloud is now private, so GITHUB_TOKEN can no longer see it and
collect.mjs's `repo:Kilo-Org/cloud` search 422s, failing the whole run.
Mint a read-only GitHub App installation token for the collect step only.
app-id: ${{ secrets.DOCS_SYNC_APP_ID }}
private-key: ${{ secrets.DOCS_SYNC_APP_SECRET }}
owner: ${{ github.repository_owner }}
repositories: cloud,kilocode

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.

SUGGESTION: Down-scope the minted token with explicit permissions

actions/create-github-app-token v2 issues the installation token with every permission granted to the app. If the docs-sync app later gains additional permissions (or already has more than Pull requests: read), this token silently carries them into the collect step. Since the PR's intent is a strictly read-only token, consider making that explicit so it holds regardless of future app-permission changes:

          repositories: cloud,kilocode
          permission-pull-requests: read

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@IamCoder18

IamCoder18 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Hey @RSO why is Cloud private?

@emilieschario said very clearly that it wouldn't be privated:

image

We are still accepting PRs with no plans to change that.

Tracked in #12970

I think it would be more productive to address the root cause (make Cloud public) instead of this PR. That would also make CI pass and keep docs up to date more transparently.

t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
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.

2 participants