Skip to content

Commit fcc84ab

Browse files
committed
improvement(ci): reuse PR checkout mirrors for integration jobs
1 parent 9e1f122 commit fcc84ab

1 file changed

Lines changed: 11 additions & 14 deletions

File tree

‎.github/workflows/checks.yml‎

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,15 @@ jobs:
129129
ENCRYPTION_KEY: '0000000000000000000000000000000000000000000000000000000000000000'
130130

131131
steps:
132-
- name: Checkout code
132+
# The writable mirror is shared per repository, so only trusted PR jobs use it.
133+
# Forks and deployment-gating pushes use a plain checkout, matching cache isolation.
134+
- &checkout-mirror
135+
name: Checkout code (mirror)
136+
if: (vars.CI_PROVIDER == '' || vars.CI_PROVIDER == 'blacksmith') && github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork
137+
uses: useblacksmith/checkout@2b9fe87d796feea153b455ec2f3125b471a7b0e7 # v1.8.2
138+
- &checkout-plain
139+
name: Checkout code
140+
if: (vars.CI_PROVIDER != '' && vars.CI_PROVIDER != 'blacksmith') || github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork
133141
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
134142

135143
- name: Setup workspace
@@ -348,19 +356,8 @@ jobs:
348356
ENCRYPTION_KEY: '0000000000000000000000000000000000000000000000000000000000000000'
349357

350358
steps:
351-
# A same-repository pull request checks out through a git mirror on a sticky disk, so a slow
352-
# clone from GitHub (1 in 10 took a minute or more, up to 4) no longer sets the run's pace.
353-
# The mirror is one disk per repository that job steps can write to, so fork pull requests
354-
# and pushes, whose checks gate a deploy, keep the plain checkout: same trust split as the
355-
# setup action's caches.
356-
- &checkout-mirror
357-
name: Checkout code (mirror)
358-
if: (vars.CI_PROVIDER == '' || vars.CI_PROVIDER == 'blacksmith') && github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork
359-
uses: useblacksmith/checkout@2b9fe87d796feea153b455ec2f3125b471a7b0e7 # v1.8.2
360-
- &checkout-plain
361-
name: Checkout code
362-
if: (vars.CI_PROVIDER != '' && vars.CI_PROVIDER != 'blacksmith') || github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork
363-
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
359+
- *checkout-mirror
360+
- *checkout-plain
364361

365362

366363
- name: Setup workspace

0 commit comments

Comments
 (0)