Skip to content

Find, verify, and analyze leaked credentials

ci: scope Smoke timeouts to trufflehog runs, not the build (#5317)

Bryan Beverlya25ff851410b
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 046be291d..907869be5 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -60,5 +60,10 @@ jobs:
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
with:
go-version: "1.27"
+ # hack/checksecretparts only needs the standard library, so this job
+ # finishes before any other and would otherwise claim the shared
+ # go.sum-keyed cache with an empty module cache. Cache keys are
+ # write-once, so that starves every later job on the branch.
+ cache: false
- name: Run checksecretparts
run: go run ./hack/checksecretparts -fail ./pkg/detectors
diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml
index 79c112b3e..2e483605c 100644
--- a/.github/workflows/smoke.yml
+++ b/.github/workflows/smoke.yml
@@ -3,9 +3,13 @@ name: Smoke
on:
pull_request:
+permissions:
+ contents: read
+
jobs:
smoke:
runs-on: ubuntu-latest
+ timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
@@ -13,14 +17,17 @@ jobs:
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
with:
go-version: "1.27"
+ - name: Build
+ run: go build -o "$RUNNER_TEMP/trufflehog" .
- name: Smoke
+ timeout-minutes: 10
run: |
set -e
- go run . git https://github.com/dustin-decker/secretsandstuff.git > /dev/null
- go run . github --repo https://github.com/dustin-decker/secretsandstuff.git > /dev/null
+ "$RUNNER_TEMP/trufflehog" git https://github.com/dustin-decker/secretsandstuff.git > /dev/null
+ "$RUNNER_TEMP/trufflehog" github --repo https://github.com/dustin-decker/secretsandstuff.git > /dev/null
zombies:
runs-on: ubuntu-latest
- timeout-minutes: 5
+ timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
@@ -28,12 +35,17 @@ jobs:
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
with:
go-version: "1.27"
+ - name: Build
+ run: go build -o "$RUNNER_TEMP/trufflehog" .
+ # The timeout covers only the scans, not the build, so a cold Go cache
+ # cannot eat into the budget that detects the #3379 deadlock.
- name: Run trufflehog
+ timeout-minutes: 5
run: |
set -e
- go run . git --no-verification file://. > /dev/null
+ "$RUNNER_TEMP/trufflehog" git --no-verification file://. > /dev/null
# This case previously had a deadlock issue and left zombies after trufflehog exited #3379
- go run . git --no-verification https://github.com/git-test-fixtures/binary.git > /dev/null
+ "$RUNNER_TEMP/trufflehog" git --no-verification https://github.com/git-test-fixtures/binary.git > /dev/null
- name: Check for running git processes and zombies
run: |
if pgrep -x "git" > /dev/null