File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 7171 run : |
7272 set -euo pipefail
7373 if [[ -f ".gitleaks.toml" ]]; then
74- # Local config exists - it should extend the centralized one
75- echo "config_arg=--config .gitleaks.toml" >> "$GITHUB_OUTPUT"
76- echo "✅ Found local config: .gitleaks.toml (should extend base config)"
74+ # Local config exists - check if it has [extend] section
75+ if grep -q "^\[extend\]" .gitleaks.toml; then
76+ # Has extend section - use as is
77+ echo "config_arg=--config .gitleaks.toml" >> "$GITHUB_OUTPUT"
78+ echo "✅ Found local config with [extend] section - using as is"
79+ else
80+ # No extend section - warn and ignore, use base config only
81+ echo "⚠️ WARNING: Local config file .gitleaks.toml exists but does not contain [extend] section"
82+ echo " We cannot be sure this is the expected extend configuration."
83+ echo " Ignoring local config file and using base config only."
84+ echo "config_arg=--config ${RUNNER_TEMP}/gitleaks.base.toml" >> "$GITHUB_OUTPUT"
85+ fi
7786 else
7887 # Use centralized config only
7988 echo "config_arg=--config ${RUNNER_TEMP}/gitleaks.base.toml" >> "$GITHUB_OUTPUT"
You can’t perform that action at this time.
0 commit comments