|
| 1 | +--- |
| 2 | +# For most projects, this workflow file will not need changing; you simply need |
| 3 | +# to commit it to your repository. |
| 4 | +# |
| 5 | +# You may wish to alter this file to override the set of languages analyzed, |
| 6 | +# or to provide custom queries or build logic. |
| 7 | +name: CodeQL |
| 8 | + |
| 9 | +# The use of on here as a key is part of the GitHub actions syntax. |
| 10 | +# yamllint disable-line rule:truthy |
| 11 | +on: |
| 12 | + merge_group: |
| 13 | + types: |
| 14 | + - checks_requested |
| 15 | + pull_request: |
| 16 | + # The branches here must be a subset of the ones in the push key |
| 17 | + branches: |
| 18 | + - develop |
| 19 | + push: |
| 20 | + # Dependabot-triggered push events have read-only access, but uploading code |
| 21 | + # scanning requires write access. |
| 22 | + branches-ignore: |
| 23 | + - dependabot/** |
| 24 | + schedule: |
| 25 | + - cron: 0 2 * * 6 |
| 26 | + |
| 27 | +jobs: |
| 28 | + diagnostics: |
| 29 | + name: Run diagnostics |
| 30 | + # This job does not need any permissions |
| 31 | + permissions: {} |
| 32 | + runs-on: ubuntu-latest |
| 33 | + steps: |
| 34 | + # Note that a duplicate of this step must be added at the top of |
| 35 | + # each job. |
| 36 | + - name: Apply standard cisagov job preamble |
| 37 | + uses: cisagov/action-job-preamble@v1 |
| 38 | + with: |
| 39 | + check_github_status: "true" |
| 40 | + # This functionality is poorly implemented and has been |
| 41 | + # causing problems due to the MITM implementation hogging or |
| 42 | + # leaking memory. If this happens to you just uncomment |
| 43 | + # this line. |
| 44 | + # monitor_permissions: "false" |
| 45 | + output_workflow_context: "true" |
| 46 | + # Use a variable to specify the permissions monitoring |
| 47 | + # configuration. By default this will yield the |
| 48 | + # configuration stored in the cisagov organization-level |
| 49 | + # variable, but if you want to use a different configuration |
| 50 | + # then simply: |
| 51 | + # 1. Create a repository-level variable with the name |
| 52 | + # ACTIONS_PERMISSIONS_CONFIG. |
| 53 | + # 2. Set this new variable's value to the configuration you |
| 54 | + # want to use for this repository. |
| 55 | + # |
| 56 | + # Note in particular that changing the permissions |
| 57 | + # monitoring configuration *does not* require you to modify |
| 58 | + # this workflow. |
| 59 | + permissions_monitoring_config: ${{ vars.ACTIONS_PERMISSIONS_CONFIG }} |
| 60 | + analyze: |
| 61 | + name: Analyze |
| 62 | + needs: |
| 63 | + - diagnostics |
| 64 | + runs-on: ubuntu-latest |
| 65 | + permissions: |
| 66 | + # actions/checkout needs this to fetch code |
| 67 | + contents: read |
| 68 | + # required for all workflows |
| 69 | + security-events: write |
| 70 | + strategy: |
| 71 | + fail-fast: false |
| 72 | + matrix: |
| 73 | + # Override automatic language detection by changing the below |
| 74 | + # list |
| 75 | + # |
| 76 | + # Supported options are actions, c-cpp, csharp, go, |
| 77 | + # java-kotlin, javascript-typescript, python, ruby, and swift. |
| 78 | + language: |
| 79 | + - actions |
| 80 | + # Learn more... |
| 81 | + # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection |
| 82 | + |
| 83 | + steps: |
| 84 | + - name: Apply standard cisagov job preamble |
| 85 | + uses: cisagov/action-job-preamble@v1 |
| 86 | + with: |
| 87 | + # This functionality is poorly implemented and has been |
| 88 | + # causing problems due to the MITM implementation hogging or |
| 89 | + # leaking memory. If this happens to you just uncomment |
| 90 | + # this line. |
| 91 | + # monitor_permissions: "false" |
| 92 | + # Use a variable to specify the permissions monitoring |
| 93 | + # configuration. By default this will yield the |
| 94 | + # configuration stored in the cisagov organization-level |
| 95 | + # variable, but if you want to use a different configuration |
| 96 | + # then simply: |
| 97 | + # 1. Create a repository-level variable with the name |
| 98 | + # ACTIONS_PERMISSIONS_CONFIG. |
| 99 | + # 2. Set this new variable's value to the configuration you |
| 100 | + # want to use for this repository. |
| 101 | + # |
| 102 | + # Note in particular that changing the permissions |
| 103 | + # monitoring configuration *does not* require you to modify |
| 104 | + # this workflow. |
| 105 | + permissions_monitoring_config: ${{ vars.ACTIONS_PERMISSIONS_CONFIG }} |
| 106 | + |
| 107 | + - name: Checkout repository |
| 108 | + uses: actions/checkout@v4 |
| 109 | + |
| 110 | + # Initializes the CodeQL tools for scanning. |
| 111 | + - name: Initialize CodeQL |
| 112 | + uses: github/codeql-action/init@v3 |
| 113 | + with: |
| 114 | + languages: ${{ matrix.language }} |
| 115 | + |
| 116 | + # Autobuild attempts to build any compiled languages (C/C++, C#, or |
| 117 | + # Java). If this step fails, then you should remove it and run the build |
| 118 | + # manually (see below). |
| 119 | + - name: Autobuild |
| 120 | + uses: github/codeql-action/autobuild@v3 |
| 121 | + |
| 122 | + # ℹ️ Command-line programs to run using the OS shell. |
| 123 | + # 📚 https://git.io/JvXDl |
| 124 | + |
| 125 | + # ✏️ If the Autobuild fails above, remove it and uncomment the following |
| 126 | + # three lines and modify them (or add more) to build your code if your |
| 127 | + # project uses a compiled language |
| 128 | + |
| 129 | + # - run: | |
| 130 | + # make bootstrap |
| 131 | + # make release |
| 132 | + |
| 133 | + - name: Perform CodeQL Analysis |
| 134 | + uses: github/codeql-action/analyze@v3 |
0 commit comments