Forbid newly added bun:test imports (incremental guard) (#2757) #1365
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Monorepo PR Bridge | |
| on: | |
| pull_request_target: | |
| types: [opened, reopened, synchronize, ready_for_review, converted_to_draft, edited, closed] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| concurrency: | |
| group: monorepo-pr-bridge-${{ github.event.pull_request.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| 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: inkeep-oss-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: Checkout agents-private | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| repository: inkeep/agents-private | |
| ref: main | |
| fetch-depth: 0 | |
| token: ${{ steps.app-token.outputs.token }} | |
| path: agents-private | |
| - name: Sync public PR into agents-private | |
| env: | |
| INTERNAL_BASE_REF: main | |
| INTERNAL_BRANCH_PREFIX: public-pr/open-knowledge | |
| INTERNAL_REPO: inkeep/agents-private | |
| INTERNAL_REPO_DIR: ${{ github.workspace }}/agents-private | |
| INTERNAL_TOKEN: ${{ steps.app-token.outputs.token }} | |
| MONOREPO_PATH_PREFIX: public/open-knowledge | |
| PUBLIC_PR_ACTION: ${{ github.event.action }} | |
| PUBLIC_PR_NUMBER: ${{ github.event.pull_request.number }} | |
| PUBLIC_REPO: ${{ github.repository }} | |
| PUBLIC_TOKEN: ${{ github.token }} | |
| # Only the 4 root-level overlay-mapped files need explicit rewrites. | |
| # Workflow + script files now live in-tree at | |
| # public/open-knowledge/.github/, so MONOREPO_PATH_PREFIX maps them | |
| # correctly without an entry here. Stale entries pointing at the | |
| # deleted overlay .github/ paths would route bridged PR diffs to | |
| # non-existent locations. | |
| PUBLIC_PR_PATH_REWRITES: >- | |
| { | |
| "README.md": "copybara/public-open-knowledge-overlay/README.md", | |
| "CONTRIBUTING.md": "copybara/public-open-knowledge-overlay/CONTRIBUTING.md", | |
| "AGENTS.md": "copybara/public-open-knowledge-overlay/AGENTS.md", | |
| ".gitignore": "copybara/public-open-knowledge-overlay/.gitignore" | |
| } | |
| # Drop pre-cutover internal-only paths from the bridged diff. Old | |
| # `inkeep/open-knowledge-legacy` branches predate the agents-private cutover | |
| # and contain reports/specs/etc. that the public mirror no longer | |
| # exports; bridging those paths back through this workflow would | |
| # re-introduce content that is already authoritative on | |
| # agents-private under different intent. | |
| BRIDGE_EXCLUDED_PATHS: >- | |
| [".codex/", ".claude/", ".cursor/", ".openhands/", ".ok/", | |
| "specs/", "reports/", "projects/", "stories/", "strategy/", | |
| "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 | |
| env: | |
| INTERNAL_BRANCH_PREFIX: public-pr/open-knowledge | |
| INTERNAL_REPO: inkeep/agents-private | |
| INTERNAL_TOKEN: ${{ steps.app-token.outputs.token }} | |
| PUBLIC_PR_NUMBER: ${{ github.event.pull_request.number }} | |
| PUBLIC_REPO: ${{ github.repository }} | |
| PUBLIC_TOKEN: ${{ github.token }} | |
| run: node .github/scripts/bridge-public-pr-to-monorepo.mjs close |