@@ -56,10 +56,10 @@ jobs:
5656 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
5757 with :
5858 ref : ${{ inputs.ref }}
59- clean : ${{ startsWith( runner.name, 'GitHub Actions') }}
59+ clean : ${{ runner.environment == 'github-hosted' }}
6060
6161 - name : Clean
62- if : ${{ !inputs.skipable && !startsWith( runner.name, 'GitHub Actions') }}
62+ if : ${{ !inputs.skipable && runner.environment == 'self-hosted' }}
6363 uses : ./.github/actions/clean
6464 with :
6565 target : ${{ inputs.target }}
9494
9595 - name : Check local cache
9696 id : check_cache
97- if : ${{ inputs.profile == 'ci' && !startsWith( runner.name, 'GitHub Actions') && !inputs.skipable }}
97+ if : ${{ inputs.profile == 'ci' && runner.environment == 'self-hosted' && !inputs.skipable }}
9898 shell : bash
9999 run : |
100100 set -e
@@ -107,7 +107,7 @@ jobs:
107107
108108 # Fix: Resolve disk space error "ENOSPC: no space left on device" on GitHub Actions runners
109109 - name : Free disk cache
110- if : ${{ startsWith( runner.name, 'GitHub Actions') && inputs.target == 'x86_64-unknown-linux-gnu' && steps.check_cache.outputs.exists != 'true' && !inputs.skipable }}
110+ if : ${{ runner.environment == 'github-hosted' && inputs.target == 'x86_64-unknown-linux-gnu' && steps.check_cache.outputs.exists != 'true' && !inputs.skipable }}
111111 uses : xc2/free-disk-space@fbe203b3788f2bebe2c835a15925da303eaa5efe # v1.0.0
112112 with :
113113 tool-cache : false
@@ -188,7 +188,7 @@ jobs:
188188 - name : Build aarch64-apple-darwin
189189 if : ${{ inputs.target == 'aarch64-apple-darwin' && steps.check_cache.outputs.files_exists != 'true' && !inputs.skipable }}
190190 run : |
191- if [[ "${{ startsWith( runner.name, 'GitHub Actions') }}" == "true" ]]; then
191+ if [[ "${{ runner.environment == 'github-hosted' }}" == "true" ]]; then
192192 # Github runner
193193 sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*;
194194 fi
@@ -218,10 +218,10 @@ jobs:
218218 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
219219 with :
220220 ref : ${{ inputs.ref }}
221- clean : ${{ startsWith( runner.name, 'GitHub Actions') }}
221+ clean : ${{ runner.environment == 'github-hosted' }}
222222
223223 - name : Clean
224- if : ${{ !startsWith( runner.name, 'GitHub Actions') }}
224+ if : ${{ runner.environment == 'self-hosted' }}
225225 uses : ./.github/actions/clean
226226 with :
227227 target : ${{ inputs.target }}
@@ -280,10 +280,10 @@ jobs:
280280 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
281281 with :
282282 ref : ${{ inputs.ref }}
283- clean : ${{ startsWith( runner.name, 'GitHub Actions') }}
283+ clean : ${{ runner.environment == 'github-hosted' }}
284284
285285 - name : Clean
286- if : ${{ !inputs.skipable && !startsWith( runner.name, 'GitHub Actions') }}
286+ if : ${{ !inputs.skipable && runner.environment == 'self-hosted' }}
287287 uses : ./.github/actions/clean
288288 with :
289289 target : ${{ inputs.target }}
@@ -379,10 +379,10 @@ jobs:
379379 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
380380 with :
381381 ref : ${{ inputs.ref }}
382- clean : ${{ startsWith( runner.name, 'GitHub Actions') }}
382+ clean : ${{ runner.environment == 'github-hosted' }}
383383
384384 - name : Clean
385- if : ${{ !startsWith( runner.name, 'GitHub Actions') }}
385+ if : ${{ runner.environment == 'self-hosted' }}
386386 uses : ./.github/actions/clean
387387 with :
388388 target : ${{ inputs.target }}
0 commit comments