~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/knotless

git that lives in your Atmosphere account

knotless.dev
1 collaborator

knotless 0.17.0 Latest 2 packages, 1 image

1
10

A step can't read its own private repository's checks or refs

Open
Open chadtmiller.com opened this issue 0 comments
area/cliarea/runnerarea/deploy

What happened

I was trying to deploy a private repository the way knotless's own deploy.yml deploys knotless: build a candidate while the checks run, wait for knotless checks … --commit $KNOTLESS_RUN_SHA --wait to pass for each workflow, check with knotless refs that main hasn't moved past the commit, then put it up.

For a private repository, nothing a step can hold lets it read its own repository's refs or checks. The repository is chadtmiller.com/group-host. Its deploy.yml runs on ci.knotless.dev, signed in as the owner with KNOTLESS_IDENTIFIER and an app password in KNOTLESS_PASSWORD, sealed to that runner for refs/heads/main. Its first run (commit 85c567b6a029) built the candidate, then failed reading the checks:

knotless: getting a delegation token, which takes an OAuth login (`knotless login`): an app password cannot read another account's private repository: InvalidToken (403): Scope does not permit reading at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host

A step can't do an OAuth login. The runner itself reads the repository through its bot's OAuth session, but a step should never hold that session: it reads every private repository the bot is a member of.

So a private repository's deploy can't wait on its own checks, and for now group-host gates its deploys on the merge queue instead.

What would make it possible: in a run of a private repository, the runner gives the step a short-lived credential scoped to that repository's space alone (for example KNOTLESS_RUN_TOKEN), and the CLI uses it for knotless checks and knotless refs (and run list) of knotless://$KNOTLESS_RUN_REPO. The step already has the checkout, so the credential shows it nothing new. Perhaps only in runs given secrets, or only on refs the owner names, as secrets are granted.