Skip to content

Commit 73ba0f9

Browse files
fix security scan workflow errors
Fixed three critical issues: - detect-languages: Added checkout step, permissions, and fixed output using core.setOutput() - gitleaks: Replaced action with CLI installation to support baseline-path parameter - codeql: Now properly receives language matrix from detect-languages job This ensures the workflow is portable and can be reused across repositories with different languages. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 7ae17f5 commit 73ba0f9

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

.github/workflows/security-scan.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,15 @@ jobs:
1414
###############################################
1515
detect-languages:
1616
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
1719
outputs:
1820
languages: ${{ steps.detect.outputs.languages }}
1921

2022
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
2126
- name: Detect languages from GitHub API
2227
id: detect
2328
uses: actions/github-script@v7
@@ -50,9 +55,9 @@ jobs:
5055
detected.push("javascript"); // default fallback
5156
}
5257
53-
return {
54-
languages: JSON.stringify([...new Set(detected)])
55-
};
58+
const languages = JSON.stringify([...new Set(detected)]);
59+
core.setOutput('languages', languages);
60+
console.log('Detected languages:', languages);
5661
5762
###############################################
5863
# 2. Run GITLEAKS (strong secret scanner)
@@ -64,10 +69,15 @@ jobs:
6469
with:
6570
fetch-depth: 0
6671

67-
- name: Run Gitleaks
68-
uses: gitleaks/gitleaks-action@v2
69-
with:
70-
args: detect --source . --verbose --redact --baseline-path gitleaks-baseline.json
72+
- name: Install Gitleaks
73+
run: |
74+
wget https://github.com/gitleaks/gitleaks/releases/download/v8.30.0/gitleaks_8.30.0_linux_x64.tar.gz
75+
tar -xzf gitleaks_8.30.0_linux_x64.tar.gz
76+
sudo mv gitleaks /usr/local/bin/
77+
gitleaks version
78+
79+
- name: Run Gitleaks with baseline
80+
run: gitleaks detect --source . --verbose --redact --baseline-path gitleaks-baseline.json
7181

7282
###############################################
7383
# 3. Run CodeQL using auto-detected languages

0 commit comments

Comments
 (0)