Skip to content

Commit 479b6ce

Browse files
Fix: Upload artifacts from directory to ensure both files are included
1 parent d22eea5 commit 479b6ce

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

.github/workflows/reusable-trufflehog.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,24 +208,29 @@ jobs:
208208
echo "❌ results.json does not exist"
209209
fi
210210
211-
- name: Ensure results.json exists
211+
- name: Prepare artifacts for upload
212212
if: always()
213213
run: |
214+
# Ensure results.json exists
214215
if [[ ! -f "results.json" ]]; then
215216
echo "[]" > results.json
216217
echo "Created empty results.json"
217218
fi
218-
echo "Files to upload:"
219-
ls -la results.json trufflehog_scan.txt 2>/dev/null || echo "Some files missing"
219+
220+
# Create artifacts directory and copy files
221+
mkdir -p trufflehog-artifacts
222+
cp trufflehog_scan.txt trufflehog-artifacts/ 2>/dev/null || echo "trufflehog_scan.txt not found"
223+
cp results.json trufflehog-artifacts/ 2>/dev/null || echo "results.json not found"
224+
225+
echo "Files in artifacts directory:"
226+
ls -la trufflehog-artifacts/
220227
221228
- name: Upload scan results
222229
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
223230
if: always()
224231
with:
225232
name: trufflehog_scan
226-
path: |
227-
trufflehog_scan.txt
228-
results.json
233+
path: trufflehog-artifacts/
229234
retention-days: 30
230235

231236
- name: Setup Python for Grafana integration

0 commit comments

Comments
 (0)