python-tuf/.github/workflows/codeql-analysis.yml
Jussi Kukkonen f005825955 workflows: Stop pinning actions that are not security relevant
These workflows have no real security relevance (runtime build or test)
in the sense that a compromise in the dependencies could compromise
python-tuf security:
* scorecards
* dependency-review
* codeql-analysis

Stop pinning the actions used in them (except the common actions that
are used everyewhere like actions/checkout: use the same version of
those everywhere). The benefit here is fewer Dependabot PRs: If we had
done this from the start we'd have skipped ~70 PRs by now.

The interesting permissions used in these workflows are
 * security-events: write
   This can add things onto the "Security" tab in GitHub
 * id-token: write
   This allows OIDC authentication, but only as this specific workflow

These permissions look completely acceptable to me.

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2023-10-02 13:34:24 +03:00

34 lines
866 B
YAML

name: "CodeQL Analysis"
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
schedule:
- cron: '30 0 * * 2'
workflow_dispatch:
permissions: {}
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
# NOTE: If you add security critical permissions, start pinning used actions
actions: read
contents: read
security-events: write # for uploading to code-scanning dashboard
steps:
- name: Checkout repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Initialize CodeQL
uses: github/codeql-action/init@v2 # unpinned since this is not security critical
with:
languages: 'python'
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2 # unpinned since this is not security critical