From 2b2ea05c12d6151c913f02e41aeec1f1389c09b7 Mon Sep 17 00:00:00 2001 From: shuppy Date: Fri, 12 Sep 2025 22:04:59 +0800 Subject: [PATCH] ci: Make runner timeout jobs conditional, not the steps (#39268) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #38503 converted the self-hosted runner timeout from a [reusable workflow](https://docs.github.com/en/actions/concepts/workflows-and-actions/reusable-workflows) to a [composite action](https://docs.github.com/en/actions/tutorials/create-actions/create-a-composite-action), but in doing so, it changed from having a conditional job to having a conditional step. [This Update Broke My Workflow](https://xkcd.com/1172/), because i enjoyed being able to tell if a job ended up being GitHub-hosted or not by seeing if its timeout job was skipped, rather than having to click on the workload job then wait then scroll up then click “Set up job”. this patch fixes that by making the job conditional. Testing: - self-hosted - GitHub-hosted Fixes: #39192 Signed-off-by: Delan Azabani --- .github/workflows/linux.yml | 2 +- .github/workflows/mac.yml | 2 +- .github/workflows/windows.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index dcdb188ee90..74bebff2712 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -111,6 +111,7 @@ jobs: runner-timeout: needs: - runner-select + if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }} runs-on: ubuntu-22.04 steps: - name: Checkout @@ -119,7 +120,6 @@ jobs: sparse-checkout: '.github' - name: Runner timeout uses: ./.github/actions/runner-timeout - if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }} with: github_token: '${{ secrets.GITHUB_TOKEN }}' unique-id: '${{ needs.runner-select.outputs.unique-id }}' diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index aef70406933..9d12acf8c7d 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -94,6 +94,7 @@ jobs: runner-timeout: needs: - runner-select + if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }} runs-on: ubuntu-22.04 steps: - name: Checkout @@ -102,7 +103,6 @@ jobs: sparse-checkout: '.github' - name: Runner timeout uses: ./.github/actions/runner-timeout - if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }} with: github_token: '${{ secrets.GITHUB_TOKEN }}' unique-id: '${{ needs.runner-select.outputs.unique-id }}' diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 5a0c2ca6237..b14a7b3be93 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -85,6 +85,7 @@ jobs: runner-timeout: needs: - runner-select + if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }} runs-on: ubuntu-22.04 steps: - name: Checkout @@ -93,7 +94,6 @@ jobs: sparse-checkout: '.github' - name: Runner timeout uses: ./.github/actions/runner-timeout - if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }} with: github_token: '${{ secrets.GITHUB_TOKEN }}' unique-id: '${{ needs.runner-select.outputs.unique-id }}'