|
| 1 | +# Copyright AGNTCY Contributors (https://github.com/agntcy) |
| 2 | +# SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +name: "CodeQL Advanced" |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: ["main"] |
| 9 | + pull_request: |
| 10 | + branches: ["main"] |
| 11 | + schedule: |
| 12 | + - cron: "42 5 * * 6" |
| 13 | + workflow_dispatch: |
| 14 | + |
| 15 | +jobs: |
| 16 | + analyze: |
| 17 | + name: Analyze |
| 18 | + # Runner size impacts CodeQL analysis time. To learn more, please see: |
| 19 | + # - https://gh.io/recommended-hardware-resources-for-running-codeql |
| 20 | + # - https://gh.io/supported-runners-and-hardware-resources |
| 21 | + # - https://gh.io/using-larger-runners (GitHub.com only) |
| 22 | + # Consider using larger runners or machines with greater resources for possible analysis time improvements. |
| 23 | + runs-on: ubuntu-latest |
| 24 | + permissions: |
| 25 | + # required for all workflows |
| 26 | + security-events: write |
| 27 | + |
| 28 | + # required to fetch internal or private CodeQL packs |
| 29 | + packages: read |
| 30 | + |
| 31 | + # only required for workflows in private repositories |
| 32 | + actions: read |
| 33 | + contents: read |
| 34 | + |
| 35 | + steps: |
| 36 | + - name: Checkout repository |
| 37 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 38 | + |
| 39 | + - name: Setup Node.js |
| 40 | + uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 |
| 41 | + with: |
| 42 | + node-version: "24.x" |
| 43 | + cache: "npm" |
| 44 | + cache-dependency-path: "**/package*.json" |
| 45 | + |
| 46 | + - name: Install JavaScript/TypeScript dependencies |
| 47 | + shell: bash |
| 48 | + run: | |
| 49 | + echo "📦 Installing JavaScript/TypeScript dependencies..." |
| 50 | + # Install dependencies for JavaScript SDK |
| 51 | + if [ -f "package.json" ]; then |
| 52 | + npm ci || npm install |
| 53 | + fi |
| 54 | + # Install dependencies for examples |
| 55 | + if [ -f "examples/package.json" ]; then |
| 56 | + cd examples |
| 57 | + npm ci || npm install |
| 58 | + cd .. |
| 59 | + fi |
| 60 | + echo "✅ JavaScript/TypeScript dependencies installed" |
| 61 | +
|
| 62 | + # Initializes the CodeQL tools for scanning. |
| 63 | + - name: Initialize CodeQL |
| 64 | + uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1 |
| 65 | + with: |
| 66 | + languages: javascript-typescript |
| 67 | + build-mode: none |
| 68 | + queries: +security-extended,security-and-quality |
| 69 | + config: | |
| 70 | + name: "CodeQL Config" |
| 71 | + queries: |
| 72 | + - uses: security-extended |
| 73 | + - uses: security-and-quality |
| 74 | + query-filters: |
| 75 | + - exclude: |
| 76 | + # Helm values files use empty strings as defaults |
| 77 | + id: js/empty-password-in-configuration-file |
| 78 | + paths-ignore: |
| 79 | + - "**/*_pb.js" |
| 80 | + - "**/*_pb.d.ts" |
| 81 | +
|
| 82 | + - name: Perform CodeQL Analysis |
| 83 | + uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1 |
| 84 | + with: |
| 85 | + category: "/language:${{matrix.language}}" |
0 commit comments