Skip to content

Commit c280341

Browse files
committed
ci: ignore detect-secrets generated_at timestamps when comparing baselines
1 parent 0795917 commit c280341

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ jobs:
3030
detect-secrets scan auth_platform dev-portal-ui/dev-portal-ui > new.baseline || true
3131
if [ -f .secrets.baseline ]; then
3232
echo "Comparing new scan to committed baseline (scoped)..."
33-
git --no-pager diff --no-index --exit-code .secrets.baseline new.baseline
33+
# Strip the generated_at timestamp from both files before comparing so
34+
# timestamp-only differences won't fail the job.
35+
sed '/"generated_at"/d' .secrets.baseline > .secrets.baseline.filtered || true
36+
sed '/"generated_at"/d' new.baseline > new.baseline.filtered || true
37+
git --no-pager diff --no-index --exit-code .secrets.baseline.filtered new.baseline.filtered
3438
else
3539
echo "No .secrets.baseline found in repo; failing to avoid accidental leaks"
3640
cat new.baseline || true

0 commit comments

Comments
 (0)