Skip to content

fix: ensure results.json is always included in trufflehog artifacts#94

Closed
isaiah-grafana wants to merge 9 commits intomainfrom
feat/upload-trufflehog-json-artifact
Closed

fix: ensure results.json is always included in trufflehog artifacts#94
isaiah-grafana wants to merge 9 commits intomainfrom
feat/upload-trufflehog-json-artifact

Conversation

@isaiah-grafana
Copy link
Copy Markdown
Contributor

Problem

When downloading trufflehog scan artifacts, only the .txt file was included, not the .json file.

Solution

  • Improved artifact preparation with better error handling
  • Ensures results.json is always present in uploaded artifacts
  • Added clearer logging to show which files are being copied
  • Creates empty results.json if scan produces no results

Changes

  • Updated artifact preparation step in reusable-trufflehog.yml
  • Better visibility into what files are being included
  • Guarantees JSON output for programmatic parsing

Result

Artifacts now always include both:

  • trufflehog_scan.txt (human-readable report)
  • results.json (parseable JSON data)

Even when no secrets are found, results.json will contain an empty array [].

- Changed to ./.github/workflows/reusable-trufflehog.yml
- Will use the same branch as the org ruleset reference
- Prepares for merging fixes into main branch
- Improved error handling for artifact preparation
- Ensures results.json is always present in uploaded artifacts
- Added clearer logging to show which files are copied
- Creates empty results.json if scan produces no results
@isaiah-grafana isaiah-grafana deleted the feat/upload-trufflehog-json-artifact branch March 5, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant