| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you under the Apache License, Version 2.0 (the |
| # "License"); you may not use this file except in compliance |
| # with the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, |
| # software distributed under the License is distributed on an |
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| # KIND, either express or implied. See the License for the |
| # specific language governing permissions and limitations |
| # under the License. |
| --- |
| name: "CodeQL" |
| |
| on: # yamllint disable-line rule:truthy |
| push: |
| branches: [main] |
| pull_request: |
| branches: [main] |
| schedule: |
| # Run weekly on Sunday at 07:13 UTC. Off-peak hour chosen so the job |
| # doesn't collide with Monday-morning CI surges. |
| - cron: "13 7 * * 0" |
| |
| permissions: |
| contents: read |
| |
| jobs: |
| analyze: |
| name: Analyze Python |
| runs-on: ubuntu-24.04 |
| permissions: |
| # Writing security-events is required for CodeQL to upload results to |
| # the repository's "Security" tab. The rest stay read-only. |
| actions: read |
| contents: read |
| security-events: write |
| |
| steps: |
| - name: Checkout |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| with: |
| persist-credentials: false |
| |
| - name: Initialize CodeQL |
| uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2 |
| with: |
| languages: python |
| # The hand-written Python in this repo lives under |
| # `tools/{vulnogram/generate-cve-json,gmail/oauth-draft}/`. Both |
| # are stdlib-only / a single OAuth dep and do not process |
| # untrusted network input at runtime, so the default |
| # `security-and-quality` query suite is sufficient — no need |
| # for `security-extended`. |
| queries: security-and-quality |
| |
| - name: Perform CodeQL analysis |
| uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2 |
| with: |
| category: "/language:python" |