| 1 | # Note: It appears that a run of codeql doesn't give you immediate |
| 2 | # feedback in the action. Results of codeql seem to show up in the |
| 3 | # Security tab. We only look there once in a while. So it seems |
| 4 | # justified to also run the codeql just "once in a while", i.e. not on |
| 5 | # every push. |
| 6 | |
| 7 | name: "CodeQL" |
| 8 | |
| 9 | on: |
| 10 | schedule: |
| 11 | - cron: "0 0 * * 1" |
| 12 | |
| 13 | permissions: |
| 14 | contents: read |
| 15 | |
| 16 | jobs: |
| 17 | analyze: |
| 18 | name: Analyze |
| 19 | # Do not run this job on any forked repos |
| 20 | if: github.repository == 'liblouis/liblouis' |
| 21 | runs-on: ubuntu-latest |
| 22 | permissions: |
| 23 | actions: read |
| 24 | contents: read |
| 25 | security-events: write |
| 26 | |
| 27 | strategy: |
| 28 | fail-fast: false |
| 29 | matrix: |
| 30 | language: ["go", "python", "cpp"] |
| 31 | # CodeQL supports [ $supported-codeql-languages ] |
| 32 | # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support |
| 33 | |
| 34 | steps: |
| 35 | - name: Harden Runner |
| 36 | uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 |
| 37 | with: |
| 38 | egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs |
| 39 | |
| 40 | - name: Checkout repository |
| 41 | uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 42 | |
| 43 | # Initializes the CodeQL tools for scanning. |
| 44 | - name: Initialize CodeQL |
| 45 | uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 |
| 46 | with: |
| 47 | languages: ${{ matrix.language }} |
| 48 | # If you wish to specify custom queries, you can do so here or in a config file. |
| 49 | # By default, queries listed here will override any specified in a config file. |
| 50 | # Prefix the list here with "+" to use these queries and those in the config file. |
| 51 | |
| 52 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). |
| 53 | # If this step fails, then you should remove it and run the build manually (see below) |
| 54 | - name: Autobuild |
| 55 | uses: github/codeql-action/autobuild@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0 |
| 56 | |
| 57 | # âšī¸ Command-line programs to run using the OS shell. |
| 58 | # đ See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun |
| 59 | |
| 60 | # If the Autobuild fails above, remove it and uncomment the following three lines. |
| 61 | # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. |
| 62 | |
| 63 | # - run: | |
| 64 | # echo "Run, Build Application using script" |
| 65 | # ./location_of_script_within_repo/buildscript.sh |
| 66 | |
| 67 | - name: Perform CodeQL Analysis |
| 68 | uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 |
| 69 | with: |
| 70 | category: "/language:${{matrix.language}}" |