Skip to content

commit change

commit change #114

name: Truffle Security Secrets Scanner
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Secret Scanning
id: trufflehog
uses: trufflesecurity/trufflehog@main
with:
extra_args: --only-verified --json
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN_2 }}
- name: Save TruffleHog Output
run: echo "${{ steps.trufflehog.outputs.json }}" > trufflehog-secrets.json
# - name: Check for secrets file
# run: |
# if [[ ! -f ./trufflehog-secrets.json ]]; then
# echo "Secrets file not found!"
# exit 1
#fi
- name: Install Snyk CLI
run: npm install -g snyk
- name: Send results to Snyk
run: |
run: snyk test --all-projects --json-file=trufflehog-secrets.json
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN_2 }}
continue-on-error: true
- name: Monitor secrets with Snyk
uses: trufflesecurity/trufflehog@main
#uses: snyk/actions/node@master
with:
command: monitor --all-projects --json-file=trufflehog-secrets.json
#with:
# command: monitor --all-sub-projects --json-file=trufflehog-secrets.json
# output: trufflehog-secrets.sarif
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN_2 }} # Use the Snyk Auth Token
continue-on-error: true