Skip to content

feat(artifact-delivery): read GitHub as the read App for builds - #491

Merged
harlan-zw merged 1 commit into
mainfrom
fix/github-read-app
Oct 6, 2026
Merged

harlan-zw merged 1 commit into
mainfrom
fix/github-read-app

Conversation

@harlan-zw

Copy link
Copy Markdown
Collaborator

Stacked on #484.

🔗 Linked issue

Related to #484

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

Public Artifact builds read GitHub with GITHUB_TOKEN. That is a personal token of the harlan-zw account: its rate limit reset matched that account's reset to the second. GitHub counts a personal token's quota per account, so the hourly sync, /gh page views, Harlan's own tools and the CI runners all spend one bucket of 5,000 requests an hour. In the 48 hours before 2026-10-06 15:00 UTC, 45 runs failed RATE_LIMITED, each in the last minutes before the hourly reset. #484 adds ARTIFACT_GITHUB_TOKEN, which still needs a second GitHub account.

Builds now read GitHub as the skilld-dev-registry-reads App. Its installation has a bucket of its own, which nothing else spends.

  • The Worker signs an RS256 JWT with WebCrypto and exchanges it for an installation token narrowed to metadata: read. It keeps the token until 5 minutes before it expires. Builds that start together share one exchange.
  • Without the App secrets, builds read with ARTIFACT_GITHUB_TOKEN, then GITHUB_TOKEN. If the App key does not parse, or GitHub refuses the token, the build reads with that fallback and emits an artifact-github-credential event with the reason. No event carries a token or the key.
  • The JWT and the token exchange reuse the private delivery code in github-app.ts. The read App has its own SKILLD_READ_APP_* names, because the GITHUB_APP_* names belong to private delivery.
  • The registry sync and page views keep GITHUB_TOKEN.

📝 Migration

Set SKILLD_READ_APP_ID, SKILLD_READ_APP_INSTALLATION_ID and SKILLD_READ_APP_PRIVATE_KEY_PKCS8 on the Worker. The key is a PKCS #8 PEM; convert a GitHub download with openssl pkcs8 -topk8 -nocrypt. Without the three secrets, builds keep the token chain above.

🤖 AI disclosure: Harlan Agent Kit modified this description. My AI open-source policy.

@harlan-zw
harlan-zw added this pull request to stack #492 October 6, 2026 15:04
@harlan-zw harlan-zw added the harlan-agent-review Pull request triage requires an adversarial Review. Adding this label manually always forces one. label Oct 6, 2026
@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. and removed harlan-agent-review Pull request triage requires an adversarial Review. Adding this label manually always forces one. labels Oct 6, 2026
@harlan-github-agent

harlan-github-agent Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🤖 MERGED

Harlan Agent Kit posted this automated review. It is not Harlan's personal review or approval. AI open source policy. Last updated: 2026-10-06 16:23 UTC.

GitHub merged this pull request.

No material findings were recorded.

The pull request closed.

@harlan-zw harlan-zw added harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Oct 6, 2026
@harlan-github-agent harlan-github-agent Bot removed the harlan-agent-running An Agent holds a Task on this issue or pull request right now. label Oct 6, 2026
Base automatically changed from fix/resolve-stability to main October 6, 2026 15:10
GitHub counts a personal token's quota per account. GITHUB_TOKEN is a
personal token, so the registry sync, page views and the account owner's
other tools spend the same bucket that builds need, and runs failed
RATE_LIMITED in the minutes before each hourly reset.

An App installation has its own bucket. Builds now mint an installation
token for the read App and fall back to ARTIFACT_GITHUB_TOKEN, then
GITHUB_TOKEN, with a reported reason when the App gives none.
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.

1 participant