Skip to content

ci: scope down release/sync-docs to dedicated GitHub Apps - #78

Merged
MuncleUscles merged 1 commit into
mainfrom
ci/scope-down-release-app-tokens
May 5, 2026
Merged

MuncleUscles merged 1 commit into
mainfrom
ci/scope-down-release-app-tokens

Conversation

@rrabenda

@rrabenda rrabenda commented May 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Reduce the attack surface of the release pipeline by replacing the shared, over-privileged CI bot with two dedicated, minimally scoped GitHub Apps gated behind protected environments.

The previous setup used a single shared App with read+write across ~30 permission categories on all org repositories. The two App tokens issued from CI workflows are now narrowly scoped:

  • publish.yml — moved under the Publish environment, switched from the archived tibdex/github-app-token@v1 to the official actions/create-github-app-token@v3. Reads vars.PUBLISH_CI_APP_CLIENT_ID and secrets.PUBLISH_CI_APP_KEY.
  • sync-docs.yml — bumped actions/create-github-app-token to @v3, switched to the explicit client-id parameter, gated behind the Sync-docs environment. Reads vars.DOCS_SYNC_APP_CLIENT_ID and secrets.DOCS_SYNC_APP_KEY. Cross-repo repositories: genlayer-docs token request is preserved.

Each App should be installed only on the repos it needs (Publish: this repo only; Sync-docs: this repo + genlayer-docs) with Contents: Read & write as the only permission.

Pre-merge checklist (GitHub side)

  • Publish environment exists with PUBLISH_CI_APP_CLIENT_ID (variable) and PUBLISH_CI_APP_KEY (secret)
  • Sync-docs environment exists with DOCS_SYNC_APP_CLIENT_ID (variable) and DOCS_SYNC_APP_KEY (secret)
  • Both Apps installed on genlayer-testing-suite (sync-docs App also on genlayer-docs) with only Contents: Read & write
  • Publish App added to branch-protection bypass list on main (semantic-release pushes the version-bump commit + tag)

Test plan

  • Land a fix: or feat: commit on main after merge and confirm publish.yml mints a token, semantic-release pushes the version bump + tag, the GitHub Release is created, and PyPI upload succeeds
  • Confirm sync-docs.yml fires automatically on release: published and pushes the API-reference update PR/commit to genlayer-docs
  • Once verified, decommission the old shared CI App from this repo and rotate / revoke its secrets

Summary by CodeRabbit

  • Chores
    • Updated CI/CD workflows to use the latest GitHub App token action with new configuration parameters for improved automation in release publishing and documentation synchronization processes.

Replace the over-privileged shared CI bot (read+write across ~30
permission categories on all org repos) with two dedicated, minimally
scoped GitHub Apps gated behind protected environments.

- publish.yml: switch to actions/create-github-app-token@v3 with
  Publish environment (vars.PUBLISH_CI_APP_CLIENT_ID,
  secrets.PUBLISH_CI_APP_KEY). Drops dependency on the archived
  tibdex/github-app-token action.
- sync-docs.yml: bump to @V3, switch to client-id, gate behind the
  Sync-docs environment (vars.DOCS_SYNC_APP_CLIENT_ID,
  secrets.DOCS_SYNC_APP_KEY).

Each App should be installed only on this repo (sync-docs additionally
on genlayer-docs) with Contents: read & write as the only permission.
@coderabbitai

coderabbitai Bot commented May 5, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The PR upgrades GitHub App token authentication across two CI workflows, replacing tibdex/github-app-token@v1 with actions/create-github-app-token@v3 and adopting new input naming (client-id instead of app-id). Both workflows also define explicit environments for their respective jobs.

Changes

GitHub App Token Action Upgrade

Layer / File(s) Summary
Environment Definition
.github/workflows/publish.yml, .github/workflows/sync-docs.yml
release-and-upload job adds environment: Publish; generate-and-sync job adds environment: Sync-docs.
Token Action Upgrade
.github/workflows/publish.yml, .github/workflows/sync-docs.yml
Both workflows upgrade GitHub App token action from tibdex/github-app-token@v1 to actions/create-github-app-token@v3 and replace app-id input with client-id using new variable names (PUBLISH_CI_APP_CLIENT_ID and DOCS_SYNC_APP_CLIENT_ID).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 From v1 tokens to v3's embrace,
Client IDs now lead the race,
Publish and docs in environments bright,
The rabbit hops—your workflows take flight! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: replacing a single shared CI GitHub App with dedicated, scoped GitHub Apps for the release and sync-docs workflows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/scope-down-release-app-tokens

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/sync-docs.yml (1)

41-45: ⚡ Quick win

actionlint warnings are false positives — client-id is valid in @v3

client-id was added and app-id deprecated in actions/create-github-app-token v3.1.0 (released April 11, 2026). The @v3 mutable tag now resolves to v3.1.0, so the client-id input works correctly at runtime and the legacy app-id input is also accepted, but client-id is recommended. actionlint 1.7.12 holds a stale copy of the action's schema (pre-v3.1.0) and both its errors can be safely ignored.

That said, pinning to a full commit SHA instead of @v3 is recommended supply-chain practice — a mutable tag can be silently updated to a different commit.

🔒 Optional: pin to a commit SHA
-        uses: actions/create-github-app-token@v3
+        uses: actions/create-github-app-token@7bd037157ab4b88c8d8f5f1fcd2ebb8a48e06ee  # v3.1.0
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/sync-docs.yml around lines 41 - 45, Replace the mutable
tag actions/create-github-app-token@v3 with a pinned reference (preferably the
exact commit SHA for the v3.1.0 release) to avoid supply-chain drift; keep the
existing inputs (client-id, private-key, repositories) as-is and re-run
actionlint (its warning is a known stale-schema false positive for client-id).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/sync-docs.yml:
- Around line 41-45: Replace the mutable tag actions/create-github-app-token@v3
with a pinned reference (preferably the exact commit SHA for the v3.1.0 release)
to avoid supply-chain drift; keep the existing inputs (client-id, private-key,
repositories) as-is and re-run actionlint (its warning is a known stale-schema
false positive for client-id).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4342153b-9938-4025-ac03-cf6857fc944a

📥 Commits

Reviewing files that changed from the base of the PR and between 75a5bcd and 27146a4.

📒 Files selected for processing (2)
  • .github/workflows/publish.yml
  • .github/workflows/sync-docs.yml

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