Repository navigation
80 lines (69 loc) · 2.54 KB
/
Copy pathcodeql.yml
File metadata and controls
80 lines (69 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: codeql.yml
permissions:
contents: read
actions: read # Required for setup-python and other actions to read action metadata
pull-requests: read # Required to list PR files for path filtering
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
UV_VERSION: "0.13.0"
UV_PROJECT_ENVIRONMENT: venv
concurrency:
group: codeql-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
cancel-in-progress: true
on:
workflow_dispatch: {}
pull_request:
branches: [master]
schedule:
- cron: "0 6 * * 1"
jobs:
analyze:
name: CodeQL analysis
runs-on: ubuntu-latest
permissions:
contents: read
actions: read # Required for setup-python and other actions to read action metadata
pull-requests: read # Required to list PR files for path filtering
security-events: write # Required for github/codeql-action/analyze to upload results
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Filter paths
id: paths
env:
GH_TOKEN: ${{ github.token }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
GITHUB_REPOSITORY: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: bash scripts/ci-pr-paths.sh
'openseries/*'
'tests/*'
'pyproject.toml'
'uv.lock'
'.github/workflows/codeql.yml'
'scripts/ci-pr-paths.sh'
- name: Initialize CodeQL
if: ${{ steps.paths.outputs.run == 'true' }}
uses: github/codeql-action/init@24c54180a607b1449ed407dd24f251e4e9147c8d # v4.38.3
with:
languages: python
- name: Set up Python
if: ${{ steps.paths.outputs.run == 'true' }}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version-file: .python-version
- name: Set up uv
if: ${{ steps.paths.outputs.run == 'true' }}
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
version: ${{ env.UV_VERSION }}
- name: Sync dependencies (locked)
if: ${{ steps.paths.outputs.run == 'true' }}
run: uv sync --locked --extra dev
- name: Perform CodeQL analysis
if: ${{ steps.paths.outputs.run == 'true' }}
uses: github/codeql-action/analyze@24c54180a607b1449ed407dd24f251e4e9147c8d # v4.38.3
with:
category: /language:python