Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ on:
push:
branches: [main]

# The private repo runs on the owner's own runner (label `box`); the public copy
# keeps GitHub's hosted runner. A new push to a PR cancels the run it replaces.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
Comment on lines +10 to +12

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Deploy the SHA that actually passed serialized CI

With two quick pushes to main, the first CI run remains active and the newer run waits in this concurrency group because cancel-in-progress is false for pushes. As soon as the older run succeeds, deploy.yml starts and lines 62-64 fetch and merge the current origin/main, so it can deploy the newer commit while that commit's CI has only just started and has not passed; GitHub confirms that concurrency permits one running and one pending run (concurrency behavior). Make the deployment consume github.event.workflow_run.head_sha (or otherwise verify that the tested SHA is still the deploy target) instead of pulling the latest branch tip.

Useful? React with 👍 / 👎.


jobs:
check:
runs-on: ubuntu-latest
runs-on: ${{ github.event.repository.private && 'box' || 'ubuntu-latest' }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep untrusted PRs off the self-hosted runner

When private-repository forking is enabled, a read-only collaborator can open a pull request whose code is checked out here and then executed by npm ci/npm test on the persistent box host. The repository.private condition therefore does not establish that PR code is trusted; route fork-origin PRs to a hosted runner (for example, by comparing the head repository with github.repository) or use an isolated ephemeral runner to prevent a PR from gaining the runner account's access to the owner's machine.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve CI for private copies without the owner’s runner

A private fork or copy that follows the repository's setup instructions has only a runner labeled krakatoa-deploy, registered with --no-default-labels (docs/self-hosting.md:317-321), so it has no runner matching box. GitHub documents that a job with no matching self-hosted runner remains queued and eventually fails after 24 hours (self-hosted runner routing); consequently CI never completes—and the workflow_run deployment never starts—for these installations. Select box through an explicit opt-in configuration or document and provision the additional runner instead of treating every private repository as the owner's configured repository.

Useful? React with 👍 / 👎.

defaults:
run:
working-directory: app
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ jobs:
iphone:
needs: server
if: needs.server.outputs.mobile == 'true' && vars.EAS_PROJECT_ID != ''
runs-on: ubuntu-latest
runs-on: ${{ github.event.repository.private && 'box' || 'ubuntu-latest' }}
timeout-minutes: 30
env:
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
Expand Down
Loading