ci: reclaim root-owned workspace files before checkout on self-hosted runners (#2713)

This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-11-16 10:01:59 -05:00
1 parent dc98b6b96a
commit 1ab090405e
1 file changed
+6
+6
View File
@@ -152,6 +152,9 @@ jobs:
runs-on: ${{ fromJSON(needs.components-runner.outputs.labels) }}
timeout-minutes: 40
steps:
- name: Reclaim files a cancelled container build left owned by root
if: runner.environment == 'self-hosted'
run: sudo -n chown -R "$(id -u):$(id -g)" "$GITHUB_WORKSPACE" || echo "::warning::could not reclaim $GITHUB_WORKSPACE"
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
@@ -350,6 +353,9 @@ jobs:
outputs:
variants: ${{ steps.variants.outputs.list }}
steps:
- name: Reclaim files a cancelled container build left owned by root
if: runner.environment == 'self-hosted'
run: sudo -n chown -R "$(id -u):$(id -g)" "$GITHUB_WORKSPACE" || echo "::warning::could not reclaim $GITHUB_WORKSPACE"
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}