Skip to content

Commit dd22631

Browse files
authored
ci: bound workflow jobs with explicit timeouts (#387)
1 parent 0f3b0b6 commit dd22631

4 files changed

Lines changed: 13 additions & 0 deletions

File tree

‎.github/workflows/codeql.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111

1212
jobs:
1313
analyze:
14+
timeout-minutes: 20
1415
name: Analyze (Go)
1516
runs-on: ubuntu-latest
1617
permissions:

‎.github/workflows/devcontainer.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ permissions:
2323

2424
jobs:
2525
devcontainer:
26+
timeout-minutes: 45
2627
runs-on: ubuntu-latest
2728
steps:
2829
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

‎.github/workflows/go.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
# passes; "stable" is the toolchain releases are built with, and is where
2121
# lint and govulncheck run (#38).
2222
build:
23+
timeout-minutes: 20
2324
runs-on: ubuntu-latest
2425
permissions:
2526
contents: read
@@ -140,6 +141,7 @@ jobs:
140141
# replacement, signals and paths differ there (#170). The race detector
141142
# runs on Linux, in build.
142143
test-os:
144+
timeout-minutes: 20
143145
runs-on: ${{ matrix.os }}
144146
permissions:
145147
contents: read
@@ -162,6 +164,7 @@ jobs:
162164
# Runs the composite action (action.yml, #126) from this checkout against
163165
# a lab zone on every runner OS: a scan, then a diff against its results.
164166
action:
167+
timeout-minutes: 20
165168
runs-on: ${{ matrix.os }}
166169
permissions:
167170
contents: read
@@ -230,6 +233,7 @@ jobs:
230233
# rather than a lab zone file from this checkout, whose format can be
231234
# newer than the release.
232235
action-release:
236+
timeout-minutes: 15
233237
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
234238
runs-on: ${{ matrix.os }}
235239
permissions:
@@ -260,6 +264,7 @@ jobs:
260264
# Builds the Dockerfile for both published platforms without pushing, so a
261265
# broken image is caught on the PR rather than during a release.
262266
docker:
267+
timeout-minutes: 30
263268
runs-on: ubuntu-latest
264269
permissions:
265270
contents: read
@@ -282,6 +287,7 @@ jobs:
282287
# (no signing, no publishing), so .goreleaser.yaml is exercised long before
283288
# a tag depends on it (#61).
284289
release-snapshot:
290+
timeout-minutes: 30
285291
needs: build
286292
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
287293
runs-on: ubuntu-latest
@@ -340,6 +346,7 @@ jobs:
340346
# failed draft). It waits for every test job, the macOS and Windows tests
341347
# and the action included, since their binaries and the action ship too.
342348
release:
349+
timeout-minutes: 30
343350
needs: [ build, test-os, action, docker ]
344351
if: startsWith(github.ref, 'refs/tags/v')
345352
runs-on: ubuntu-latest
@@ -423,6 +430,7 @@ jobs:
423430
# (#40). The Dockerfile cross-compiles in a build-platform builder stage, so
424431
# arm64 needs no QEMU. `latest` only moves for non-prerelease tags.
425432
publish-image:
433+
timeout-minutes: 30
426434
needs: release
427435
if: startsWith(github.ref, 'refs/tags/v')
428436
runs-on: ubuntu-latest
@@ -489,6 +497,7 @@ jobs:
489497
# deletes a draft (never a published release) and is a no-op when there is
490498
# nothing to clean, so it is safe and idempotent.
491499
cleanup-failed-release:
500+
timeout-minutes: 5
492501
needs: [release]
493502
if: ${{ failure() && startsWith(github.ref, 'refs/tags/v') }}
494503
runs-on: ubuntu-latest

‎.github/workflows/pages.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ concurrency:
2525

2626
jobs:
2727
build:
28+
timeout-minutes: 15
2829
runs-on: ubuntu-latest
2930
steps:
3031
- name: Checkout
@@ -45,6 +46,7 @@ jobs:
4546
path: ./_site
4647

4748
deploy:
49+
timeout-minutes: 10
4850
permissions:
4951
contents: read
5052
pages: write

0 commit comments

Comments
 (0)