From 1ab090405effb5d97632d20cdd194d1e4283c8b8 Mon Sep 17 00:00:00 2001 From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> Date: Mon, 16 Nov 2026 10:01:59 -0500 Subject: [PATCH] ci: reclaim root-owned workspace files before checkout on self-hosted runners (#2713) --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b836d480d..52c70b7d8f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 }}