Security Audit #70
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 Audit | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| - 'feature/**' | |
| - 'claude/**' | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| schedule: | |
| # Run every day at 2:00 AM UTC | |
| - cron: '0 2 * * *' | |
| workflow_dispatch: # Allow manual trigger | |
| permissions: | |
| contents: read | |
| security-events: write | |
| jobs: | |
| npm-audit: | |
| name: NPM Security Audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@71cf2267d89c5cb81562390fa70a37fa40b1305e # v5.0.0 | |
| - name: Setup Node.js project | |
| uses: ./.github/actions/setup-node-project | |
| - name: Run npm audit | |
| run: npm audit --audit-level=moderate | |
| continue-on-error: true | |
| - name: Generate audit report | |
| run: npm audit --json > npm-audit-report.json || true | |
| - name: Upload audit report | |
| if: always() | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: npm-audit-report | |
| path: npm-audit-report.json | |
| retention-days: 30 | |
| composer-audit: | |
| name: Composer Security Audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@71cf2267d89c5cb81562390fa70a37fa40b1305e # v5.0.0 | |
| - name: Setup PHP project | |
| uses: ./.github/actions/setup-php-project | |
| - name: Generate audit report | |
| run: composer audit --format=json > composer-audit-report.json || true | |
| - name: Display audit results | |
| run: composer audit | |
| - name: Upload audit report | |
| if: always() | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: composer-audit-report | |
| path: composer-audit-report.json | |
| retention-days: 30 | |
| dependency-review: | |
| name: Dependency Review | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@71cf2267d89c5cb81562390fa70a37fa40b1305e # v5.0.0 | |
| - name: Run dependency review | |
| uses: actions/dependency-review-action@40c09b7dc99638e5ddb0bfd91c1673effc064d8a # v4.8.1 | |
| with: | |
| fail-on-severity: moderate | |
| comment-summary-in-pr: always |