Files
Bryan BeverlyandCursor 8fe2bd7452 ci: scope Smoke timeouts to trufflehog runs, not the build
The `zombies` job had a job-level `timeout-minutes: 5` that covered a full
binary compile as well as the two scans it is meant to bound. On PRs that
change `go.sum` the Go cache is cold, the compile takes ~2m30s instead of
~29s, and the job exceeds 5 minutes even though the zombie check itself
passes. PR #5280 hit this on both attempts; #5273 passed with 19s to spare.

Build to `$RUNNER_TEMP` in a separate step and move `timeout-minutes` onto
the run step, so the 5-minute budget now measures only the scans (~1m42s)
and no longer depends on build speed. A step-level timeout also fails the
job rather than cancelling it, which is a clearer signal.

`smoke` had no timeout at all and inherited the 360-minute default despite
doing under a minute of work, so a hang in its live-verification scans
burned six hours of runner time. Both jobs now cap at 15 minutes to catch
build and infrastructure hangs.

Also set `cache: false` on setup-go in `checksecretparts`. That job is
stdlib-only and finishes in ~23s, so it wins the race to write the
`go.sum`-keyed cache and saves ~10MB with no module cache at all. Cache
keys are write-once, so every later job on the branch restores the empty
entry and cannot replace it.

Co-authored-by: Cursor <[email protected]>
2026-09-15 09:30:37 -07:00
..
2026-08-25 09:17:27 -07:00
2026-07-31 00:50:23 -07:00
2026-09-04 11:50:57 -07:00
2026-07-31 00:50:23 -07:00

GitHub Workflows

This directory contains GitHub Actions workflows for the TruffleHog repository.

PR Approval Check (pr-approval-check.yml)

This workflow enforces that at least one PR approver must be an active member of the @trufflesecurity/product-eng team or any of its child teams.

How it works:

  1. Triggers: The workflow runs on:

    • pull_request_review events when a review is submitted (submitted type)
    • pull_request events when a PR is opened, reopened, or synchronized (opened, reopened, synchronize types)
  2. Approval Check Process: The workflow:

    • Fetches all reviews for the PR using the GitHub API
    • Filters for reviews with state APPROVED
    • Gets all child teams of @trufflesecurity/product-eng using listChildInOrg API
    • Checks if any approver is an active member (not pending) of either:
      • The parent @trufflesecurity/product-eng team, OR
      • Any of its child teams
    • Sets a commit status accordingly
  3. Status Check: Creates a commit status named product-eng-approval with:

    • ✅ Success: When at least one approver is an active member of @trufflesecurity/product-eng or any child team
    • ❌ Failure: When there are no approvals or there are approvals but none from active @trufflesecurity/product-eng members

Error Handling

If there are errors listing reviews or checking team membership, the workflow reports a failure status and also fails itself.

Branch Protection

To make this check required:

  1. Go to Settings → Branches
  2. Add or edit a branch protection rule for your main branch
  3. Enable "Require status checks to pass before merging"
  4. Add pr-approval-check to the required status checks

Permissions

The workflow uses the default GITHUB_TOKEN which has sufficient permissions to:

  • Read PR reviews
  • List child teams and check team membership (for public teams)
  • Create commit statuses

Note: If the product-eng team or its child teams are private, you may need to use a personal access token with appropriate permissions. The Github API returns 404 for non-members and for lack of permissions.