Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/trufflehog-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Copyright (c) 2003-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved
# TruffleHog Secret Scanning - Reusable Workflow
# This workflow scans for secrets in pull request changes
# Note: This workflow expects to be called from a pull_request event context
name: TruffleHog Scan

on:
workflow_call:

jobs:
trufflehog-scan:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Prepare scan arguments
id: prep
shell: bash
run: |
ARGS="--json --fail"
# Only add exclude-paths if file exists
if [ -f ".trufflehog-exclude" ]; then
ARGS="$ARGS --exclude-paths=.trufflehog-exclude"
echo "Using exclusion file: .trufflehog-exclude"
else
echo "No exclusion file found, scanning all files"
fi
echo "args=${ARGS}" >> "$GITHUB_OUTPUT"

- name: Secret Scanning
uses: trufflesecurity/trufflehog@main
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using '@main' for the TruffleHog action is not recommended for production workflows as it may introduce breaking changes without notice. Consider pinning to a specific version or commit SHA for stability and reproducibility.

Suggested change
uses: trufflesecurity/trufflehog@main
uses: trufflesecurity/trufflehog@v3

Copilot uses AI. Check for mistakes.
with:
base: ${{ github.event.pull_request.base.sha }}
head: ${{ github.event.pull_request.head.sha }}
extra_args: ${{ steps.prep.outputs.args }}

# ------------------------------------------------------------------------------
# HOW TO EXCLUDE FILES/FOLDERS
# ------------------------------------------------------------------------------
# Create a .trufflehog-exclude file in your repository root with patterns:
#
# Example .trufflehog-exclude content:
# # Exclude specific files
# path/to/file.txt
# config/secrets.example.env
#
# # Exclude entire folders
# tests/fixtures/**
# **/test_data/**
#
# # Exclude by pattern
# *.test.env
# **/*.example
#
# # Exclude documentation
# docs/**
#
# Patterns follow .gitignore syntax:
# - ** matches any number of directories
# - * matches any characters except /
# - One pattern per line
# - Lines starting with # are comments
# ------------------------------------------------------------------------------
9 changes: 8 additions & 1 deletion templates/pr-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,11 @@ jobs:
permissions:
contents: read
pull-requests: write
issues: write
issues: write
trufflehog-scan:
name: TruffleHog Scan
uses: marklogic/pr-workflows/.github/workflows/trufflehog-scan.yml@main
permissions:
contents: read