Repository navigation
CI: run on the owner's runner in the private repo #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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' }} | ||
|
|
||
| jobs: | ||
| check: | ||
| runs-on: ubuntu-latest | ||
| runs-on: ${{ github.event.repository.private && 'box' || 'ubuntu-latest' }} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
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 Useful? React with 👍 / 👎. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
A private fork or copy that follows the repository's setup instructions has only a runner labeled Useful? React with 👍 / 👎. |
||
| defaults: | ||
| run: | ||
| working-directory: app | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With two quick pushes to
main, the first CI run remains active and the newer run waits in this concurrency group becausecancel-in-progressis false for pushes. As soon as the older run succeeds,deploy.ymlstarts and lines 62-64 fetch and merge the currentorigin/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 consumegithub.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 👍 / 👎.