Merge pull request #803 from Fayvor22/gas-cost #781
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: Dependency & Security Check | |
| on: | |
| push: | |
| branches: [master, main, develop] | |
| pull_request: | |
| branches: [master, main, develop] | |
| schedule: | |
| # Daily at 06:00 UTC | |
| - cron: '0 6 * * *' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| security-events: write | |
| pull-requests: write | |
| env: | |
| NODE_VERSION: '20' | |
| jobs: | |
| npm-audit: | |
| name: NPM Security Audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: npm | |
| - run: npm ci | |
| - name: Run npm audit (high severity) | |
| run: npm audit --audit-level=high | |
| - name: Generate full audit report | |
| if: always() | |
| run: npm audit --json > audit-report.json || true | |
| - name: Upload audit report | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: npm-audit-report | |
| path: audit-report.json | |
| retention-days: 30 | |
| outdated-check: | |
| name: Outdated Dependencies | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: npm | |
| - run: npm ci | |
| - name: Check outdated packages | |
| run: | | |
| echo "## Outdated Dependencies" >> "$GITHUB_STEP_SUMMARY" | |
| echo '```' >> "$GITHUB_STEP_SUMMARY" | |
| npm outdated || true >> "$GITHUB_STEP_SUMMARY" | |
| echo '```' >> "$GITHUB_STEP_SUMMARY" |