Security Scan #20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Security Scan | |
| on: | |
| schedule: | |
| - cron: "0 0 * * 0" # 每周日运行 | |
| workflow_dispatch: # 允许手动触发 | |
| jobs: | |
| security-scan: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 8 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: "8" | |
| distribution: "temurin" | |
| cache: maven | |
| - name: Initialize CodeQL | |
| uses: github/codeql-action/init@v3 | |
| with: | |
| languages: java | |
| - name: Build with Maven | |
| run: mvn -B package --file pom.xml | |
| - name: Perform CodeQL Analysis | |
| uses: github/codeql-action/analyze@v3 | |
| - name: Run OWASP Dependency Check | |
| run: mvn org.owasp:dependency-check-maven:check | |
| - name: Upload Security Reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: security-scan-reports | |
| path: | | |
| target/dependency-check-report.html | |
| target/dependency-check-report.json |