ci: Make runner timeout jobs conditional, not the steps (#39268)

#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
<https://github.com/servo/servo/actions/runs/17674214808/job/50232483209>
- GitHub-hosted
<https://github.com/delan/servo/actions/runs/17674531369/job/50233465791>

Fixes: #39192

Signed-off-by: Delan Azabani <dazabani@igalia.com>
This commit is contained in:
shuppy 2025-09-12 22:04:59 +08:00 committed by GitHub
parent 4aabc67e57
commit 2b2ea05c12
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View file

@ -111,6 +111,7 @@ jobs:
runner-timeout: runner-timeout:
needs: needs:
- runner-select - runner-select
if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }}
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- name: Checkout - name: Checkout
@ -119,7 +120,6 @@ jobs:
sparse-checkout: '.github' sparse-checkout: '.github'
- name: Runner timeout - name: Runner timeout
uses: ./.github/actions/runner-timeout uses: ./.github/actions/runner-timeout
if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }}
with: with:
github_token: '${{ secrets.GITHUB_TOKEN }}' github_token: '${{ secrets.GITHUB_TOKEN }}'
unique-id: '${{ needs.runner-select.outputs.unique-id }}' unique-id: '${{ needs.runner-select.outputs.unique-id }}'

View file

@ -94,6 +94,7 @@ jobs:
runner-timeout: runner-timeout:
needs: needs:
- runner-select - runner-select
if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }}
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- name: Checkout - name: Checkout
@ -102,7 +103,6 @@ jobs:
sparse-checkout: '.github' sparse-checkout: '.github'
- name: Runner timeout - name: Runner timeout
uses: ./.github/actions/runner-timeout uses: ./.github/actions/runner-timeout
if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }}
with: with:
github_token: '${{ secrets.GITHUB_TOKEN }}' github_token: '${{ secrets.GITHUB_TOKEN }}'
unique-id: '${{ needs.runner-select.outputs.unique-id }}' unique-id: '${{ needs.runner-select.outputs.unique-id }}'

View file

@ -85,6 +85,7 @@ jobs:
runner-timeout: runner-timeout:
needs: needs:
- runner-select - runner-select
if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }}
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- name: Checkout - name: Checkout
@ -93,7 +94,6 @@ jobs:
sparse-checkout: '.github' sparse-checkout: '.github'
- name: Runner timeout - name: Runner timeout
uses: ./.github/actions/runner-timeout uses: ./.github/actions/runner-timeout
if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }}
with: with:
github_token: '${{ secrets.GITHUB_TOKEN }}' github_token: '${{ secrets.GITHUB_TOKEN }}'
unique-id: '${{ needs.runner-select.outputs.unique-id }}' unique-id: '${{ needs.runner-select.outputs.unique-id }}'