Skip to content

Commit 3edcdbd

Browse files
cursoragenteps1lon
andcommitted
Use runner.environment to detect GitHub-hosted runners
Use runner.environment == 'github-hosted' instead of checking runs_on_labels for 'ubuntu-latest'. This is more reliable as it directly checks the runner type rather than inferring from labels. Co-authored-by: sebastian.silbermann <sebastian.silbermann@vercel.com>
1 parent 77d83e8 commit 3edcdbd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/build_reusable.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,12 @@ jobs:
202202

203203
# Cache pnpm store on GitHub-hosted runners (self-hosted runners have their own persistent storage)
204204
- name: Get pnpm store directory
205-
if: ${{ contains(fromJson(inputs.runs_on_labels), 'ubuntu-latest') }}
205+
if: ${{ runner.environment == 'github-hosted' }}
206206
id: get-store-path
207207
run: echo STORE_PATH=$(pnpm store path) >> $GITHUB_OUTPUT
208208

209209
- name: Cache pnpm store
210-
if: ${{ contains(fromJson(inputs.runs_on_labels), 'ubuntu-latest') }}
210+
if: ${{ runner.environment == 'github-hosted' }}
211211
uses: actions/cache@v4
212212
timeout-minutes: 5
213213
id: cache-pnpm-store

0 commit comments

Comments
 (0)