Find, verify, and analyze leaked credentials
Go credentialsdevsecopsdynamic-analysisprecommitscanningsecretsecret-managementsecretssecuritysecurity-toolstrufflehogverification
Update tests for forks so we don't fail on everything (#1475)
Zachary Rice0bbe62cec5e6
diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.ymlindex c0a9d7730..1655a819f 100644--- a/.github/workflows/performance.yml+++ b/.github/workflows/performance.yml@@ -4,6 +4,10 @@ on: [pull_request]jobs:speed:+ # skip if PR is from a fork.+ # TODO: this could probabaly be refactored a bit so that it runs on forks+ if: ${{ ! github.event.pull_request.head.repo.fork }}+runs-on: ubuntu-lateststeps:- name: Install Go@@ -85,4 +89,4 @@ jobs:thenecho "HEAD run time is at least 10% slower than PREVIOUS run time"exit 1- fi\ No newline at end of file+ fidiff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.ymlindex 6d6d85810..70bfe7226 100644--- a/.github/workflows/smoke.yml+++ b/.github/workflows/smoke.yml@@ -14,9 +14,6 @@ jobs:go-version: '1.18'- name: Checkout codeuses: actions/checkout@v3- with:- fetch-depth: 0- ref: ${{ github.head_ref }}- name: Smokerun: |set -ediff --git a/.github/workflows/test.yml b/.github/workflows/test.ymlindex cc7133014..e2d916196 100644--- a/.github/workflows/test.yml+++ b/.github/workflows/test.yml@@ -11,6 +11,7 @@ on:jobs:test:+ if: ${{ ! github.event.pull_request.head.repo.fork }}runs-on: ubuntu-latestpermissions:actions: 'read'@@ -31,6 +32,7 @@ jobs:- name: Testrun: make test-integrationtest-detectors:+ if: ${{ ! github.event.pull_request.head.repo.fork }}runs-on: ubuntu-latestpermissions:actions: 'read'@@ -50,4 +52,19 @@ jobs:service_account: '[email protected]'- name: Testrun: make test-detectors- continue-on-error: true+ continue-on-error: true+ test-fork:+ if: ${{ github.event.pull_request.head.repo.fork }}+ runs-on: ubuntu-latest+ permissions:+ actions: 'read'+ contents: 'read'+ steps:+ - name: Install Go+ uses: actions/setup-go@v4+ with:+ go-version: '1.20'+ - name: Checkout code+ uses: actions/checkout@v3+ - name: Test+ run: make test-forksdiff --git a/Makefile b/Makefileindex c77ab97c6..2740245bb 100644--- a/Makefile+++ b/Makefile@@ -39,6 +39,9 @@ test-race:test-detectors:CGO_ENABLED=0 go test -tags=detectors -timeout=5m $(shell go list ./... | grep pkg/detectors)+test-forks:+ CGO_ENABLED=0 go test -timeout=5m $(shell go list ./... | grep -v /vendor/ | grep -v pkg/detectors | grep -v pkg/sources)+bench:CGO_ENABLED=0 go test $(shell go list ./pkg/secrets/... | grep -v /vendor/) -benchmem -run=xxx -bench .