Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

Gate public PR bridge syncs with environment approval (#2516)

robert-inkeepadb36966ed44
diff --git a/.github/workflows/monorepo-pr-bridge.yml b/.github/workflows/monorepo-pr-bridge.yml
index 34bfd0bda..f7eeb227c 100644
--- a/.github/workflows/monorepo-pr-bridge.yml
+++ b/.github/workflows/monorepo-pr-bridge.yml
@@ -15,8 +15,12 @@ concurrency:
jobs:
sync:
- # Skip PRs that originated from agents-private via Copybara.
- if: github.event.pull_request.head.ref != 'copybara/sync'
+ # Pause before minting the agents-private App token or writing any internal
+ # branch/PR. The environment has required reviewers configured in the public
+ # repo, so every public PR revision needs maintainer approval before crossing
+ # into agents-private.
+ if: github.event.action != 'closed' && github.event.pull_request.head.ref != 'copybara/sync'
+ environment: sync-to-agents-private
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
@@ -40,7 +44,6 @@ jobs:
repositories: agents-private
- name: Checkout agents-private
- if: github.event.action != 'closed'
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: inkeep/agents-private
@@ -50,7 +53,6 @@ jobs:
path: agents-private
- name: Sync public PR into agents-private
- if: github.event.action != 'closed'
env:
INTERNAL_BASE_REF: main
INTERNAL_BRANCH_PREFIX: public-pr/open-knowledge
@@ -87,8 +89,32 @@ jobs:
"private/", "ARCHITECTURE.md", "PRECEDENTS.md"]
run: node .github/scripts/bridge-public-pr-to-monorepo.mjs sync
+ close:
+ # Skip PRs that originated from agents-private via Copybara.
+ if: github.event.action == 'closed' && github.event.pull_request.head.ref != 'copybara/sync'
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+ steps:
+ - name: Checkout public repo automation
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ fetch-depth: 1
+
+ - name: Setup Node.js
+ uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
+ with:
+ node-version: 22
+
+ - name: Generate inkeep-oss-sync App token
+ id: app-token
+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
+ with:
+ app-id: ${{ secrets.OSS_SYNC_APP_ID }}
+ private-key: ${{ secrets.OSS_SYNC_APP_PRIVATE_KEY }}
+ owner: inkeep
+ repositories: agents-private
+
- name: Handle public PR closure
- if: github.event.action == 'closed'
env:
INTERNAL_BRANCH_PREFIX: public-pr/open-knowledge
INTERNAL_REPO: inkeep/agents-private