Skip to content

Commit 6c8d59a

Browse files
hugovkvstinner
andauthored
Add zizmor security linter (#238)
Pin 'build' to version and hash, update with Dependabot. Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent 200aa57 commit 6c8d59a

11 files changed

Lines changed: 117 additions & 10 deletions

File tree

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,14 @@ updates:
1313
# Cooldowns protect against supply chain attacks by avoiding the
1414
# highest-risk window immediately after new releases.
1515
default-days: 14
16+
17+
- package-ecosystem: pip
18+
directory: "/.github/workflows"
19+
schedule:
20+
interval: monthly
21+
groups:
22+
pip:
23+
patterns:
24+
- "*"
25+
cooldown:
26+
default-days: 7

.github/workflows/build.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
name: Build
22

3-
on:
4-
push:
5-
pull_request:
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
permissions: {}
6+
7+
env:
8+
FORCE_COLOR: 1
69

710
jobs:
811
tox-jobs:
@@ -13,6 +16,8 @@ jobs:
1316
runs-on: ubuntu-latest
1417
steps:
1518
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
19+
with:
20+
persist-credentials: false
1621
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
1722
with:
1823
python-version: 3.x
@@ -45,6 +50,8 @@ jobs:
4550

4651
steps:
4752
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
53+
with:
54+
persist-credentials: false
4855
- name: Setup Python
4956
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
5057
if: ${{ matrix.build != 'free-threading' }}

.github/workflows/lint.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Lint
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
permissions: {}
6+
7+
env:
8+
FORCE_COLOR: 1
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
16+
with:
17+
persist-credentials: false
18+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
19+
with:
20+
python-version: "3.x"
21+
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
22+
- uses: j178/prek-action@cbc2f23eb5539cf20d82d1aabd0d0ecbcc56f4e3 # v2.0.2

.github/workflows/publish.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build

.github/workflows/publish.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.14
3+
# by the following command:
4+
#
5+
# pip-compile --generate-hashes --output-file=.github/workflows/publish.txt .github/workflows/publish.in
6+
#
7+
build==1.4.4 \
8+
--hash=sha256:8c3f48a6090b39edec1a273d2d57949aaf13723b01e02f9d518396887519f64d \
9+
--hash=sha256:f832ae053061f3fb524af812dc94b8b84bac6880cd587630e3b5d91a6a9c1703
10+
# via -r /private/tmp/pyperf/.github/workflows/publish.in
11+
packaging==26.1 \
12+
--hash=sha256:5d9c0669c6285e491e0ced2eee587eaf67b670d94a19e94e3984a481aba6802f \
13+
--hash=sha256:f042152b681c4bfac5cae2742a55e103d27ab2ec0f3d88037136b6bfe7c9c5de
14+
# via build
15+
pyproject-hooks==1.2.0 \
16+
--hash=sha256:1e859bd5c40fae9448642dd871adf459e5e2084186e8d2c2a79a824c970da1f8 \
17+
--hash=sha256:9e5c6bfa8dcc30091c74b0cf803c81fdd29d94f01992a7707bc97babb1141913
18+
# via build

.github/workflows/publish.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44
release:
55
types: [published]
66

7+
permissions: {}
8+
9+
env:
10+
FORCE_COLOR: 1
11+
712
jobs:
813
deploy:
914
runs-on: ubuntu-latest
@@ -14,15 +19,15 @@ jobs:
1419

1520
steps:
1621
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
22+
with:
23+
persist-credentials: false
1724
- name: Set up Python
1825
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
1926
with:
2027
python-version: '3.x'
21-
cache: pip
22-
cache-dependency-path: pyproject.toml
2328
- name: Install dependencies
2429
run: |
25-
python -m pip install --user --upgrade build
30+
python -m pip install --no-deps -r .github/workflows/publish.txt
2631
- name: Build
2732
run: |
2833
python -m build

.pre-commit-config.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
4+
hooks:
5+
- id: check-added-large-files
6+
- id: check-case-conflict
7+
- id: check-merge-conflict
8+
- id: check-json
9+
- id: check-toml
10+
- id: check-yaml
11+
- id: debug-statements
12+
- id: end-of-file-fixer
13+
- id: forbid-submodules
14+
- id: trailing-whitespace
15+
16+
- repo: https://github.com/python-jsonschema/check-jsonschema
17+
rev: 0.37.1
18+
hooks:
19+
- id: check-dependabot
20+
- id: check-github-workflows
21+
22+
- repo: https://github.com/rhysd/actionlint
23+
rev: v1.7.12
24+
hooks:
25+
- id: actionlint
26+
27+
- repo: https://github.com/zizmorcore/zizmor-pre-commit
28+
rev: v1.24.1
29+
hooks:
30+
- id: zizmor
31+
32+
- repo: https://github.com/abravalheri/validate-pyproject
33+
rev: v0.25
34+
hooks:
35+
- id: validate-pyproject
36+
37+
- repo: meta
38+
hooks:
39+
- id: check-hooks-apply
40+
- id: check-useless-excludes

doc/developer_guide.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ Perf Developer Guide
88
examples
99
api
1010
changelog
11-

doc/examples.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,3 @@ Usage::
122122

123123
$ python3 plot.py telco.json telco.csv
124124
$ python3 plot.py result.json -b telco telco.csv
125-

doc/user_guide.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@ Table of Contents:
1111
cli
1212
runner
1313
system
14-
15-

0 commit comments

Comments
 (0)