Skip to content

Commit 6cef1cd

Browse files
committed
chore: obey zizmor
1 parent 9f11681 commit 6cef1cd

10 files changed

Lines changed: 64 additions & 39 deletions

File tree

.github/workflows/check_changelogs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
17+
with:
18+
persist-credentials: false
1719

1820
- name: Install uv
1921
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0

.github/workflows/codspeed.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,20 @@ jobs:
1919
github.event_name == 'workflow_dispatch' ||
2020
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'benchmark'))
2121
steps:
22-
- uses: actions/checkout@v6
22+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2323
with:
2424
fetch-depth: 0
25+
persist-credentials: false
2526
- name: Set up Python
26-
uses: actions/setup-python@v6
27+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2728
with:
2829
python-version: "3.11"
2930
- name: Install Hatch
3031
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc
3132
with:
3233
version: '1.16.5'
3334
- name: Run the benchmarks
34-
uses: CodSpeedHQ/action@v4
35+
uses: CodSpeedHQ/action@1c8ae4843586d3ba879736b7f6b7b0c990757fab # v4.12.1
3536
with:
3637
mode: walltime
3738
run: hatch run test.py3.11-minimal:pytest tests/benchmarks --codspeed

.github/workflows/gpu_test.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ jobs:
3030
python-version: ['3.11']
3131

3232
steps:
33-
- uses: actions/checkout@v6
33+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3434
with:
3535
fetch-depth: 0 # grab all branches and tags
36+
persist-credentials: false
3637
# - name: cuda-toolkit
3738
# uses: Jimver/cuda-toolkit@v0.2.16
3839
# id: cuda-toolkit
@@ -52,7 +53,7 @@ jobs:
5253
echo $LD_LIBRARY_PATH
5354
nvcc -V
5455
- name: Set up Python
55-
uses: actions/setup-python@v6
56+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
5657
with:
5758
python-version: ${{ matrix.python-version }}
5859
cache: 'pip'
@@ -71,5 +72,7 @@ jobs:
7172
- name: Upload coverage
7273
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
7374
with:
74-
token: ${{ secrets.CODECOV_TOKEN }}
75+
# CODECOV_TOKEN is a low-sensitivity upload token, not a deploy key.
76+
# Using an environment would gate every test run behind approval/deployment UI.
77+
token: ${{ secrets.CODECOV_TOKEN }} # zizmor: ignore[secrets-outside-env]
7578
verbose: true # optional (default = false)

.github/workflows/hypothesis.yaml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ jobs:
3030
dependency-set: ["optional"]
3131

3232
steps:
33-
- uses: actions/checkout@v6
33+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
34+
with:
35+
persist-credentials: false
3436
- name: Set HYPOTHESIS_PROFILE based on trigger
3537
run: |
3638
if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
@@ -39,7 +41,7 @@ jobs:
3941
echo "HYPOTHESIS_PROFILE=ci" >> $GITHUB_ENV
4042
fi
4143
- name: Set up Python
42-
uses: actions/setup-python@v6
44+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
4345
with:
4446
python-version: ${{ matrix.python-version }}
4547
cache: 'pip'
@@ -54,7 +56,7 @@ jobs:
5456
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
5557
- name: Restore cached hypothesis directory
5658
id: restore-hypothesis-cache
57-
uses: actions/cache/restore@v5
59+
uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
5860
with:
5961
path: .hypothesis/
6062
key: cache-hypothesis-${{ runner.os }}-${{ github.run_id }}
@@ -72,15 +74,17 @@ jobs:
7274
- name: Save cached hypothesis directory
7375
id: save-hypothesis-cache
7476
if: always() && steps.status.outcome != 'skipped'
75-
uses: actions/cache/save@v5
77+
uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
7678
with:
7779
path: .hypothesis/
7880
key: cache-hypothesis-${{ runner.os }}-${{ github.run_id }}
7981

8082
- name: Upload coverage
81-
uses: codecov/codecov-action@v5
83+
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
8284
with:
83-
token: ${{ secrets.CODECOV_TOKEN }}
85+
# CODECOV_TOKEN is a low-sensitivity upload token, not a deploy key.
86+
# Using an environment would gate every test run behind approval/deployment UI.
87+
token: ${{ secrets.CODECOV_TOKEN }} # zizmor: ignore[secrets-outside-env]
8488
verbose: true # optional (default = false)
8589

8690
- name: Generate and publish the report
@@ -89,7 +93,7 @@ jobs:
8993
&& steps.status.outcome == 'failure'
9094
&& github.event_name == 'schedule'
9195
&& github.repository_owner == 'zarr-developers'
92-
uses: scientific-python/issue-from-pytest-log-action@v1
96+
uses: scientific-python/issue-from-pytest-log-action@8e905db353437cda1d6a773de245343fbfc940dd # v1.5.0
9397
with:
9498
log-path: output-${{ matrix.python-version }}-log.jsonl
9599
issue-title: "Nightly Hypothesis tests failed"

.github/workflows/issue-metrics.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ jobs:
2929
echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV"
3030
3131
- name: Run issue-metrics tool
32-
uses: github/issue-metrics@v3
32+
uses: github/issue-metrics@67526e7bd8100b870f10b1c120780a8375777b43 # v3.25.5
3333
env:
3434
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3535
SEARCH_QUERY: 'repo:zarr-developers/zarr-python is:issue created:${{ env.last_month }} -reason:"not planned"'
3636

3737
- name: Create issue
38-
uses: peter-evans/create-issue-from-file@v6
38+
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v6.0.0
3939
with:
4040
title: Monthly issue metrics report
4141
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lint.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,7 @@ jobs:
1919
name: Lint
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v6
23-
- uses: j178/prek-action@v1
22+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
23+
with:
24+
persist-credentials: false
25+
- uses: j178/prek-action@0bb87d7f00b0c99306c8bcb8b8beba1eb581c037 # v1.1.1

.github/workflows/needs_release_notes.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
name: "Pull Request Labeler"
22

33
on:
4-
pull_request_target:
4+
# pull_request_target is needed to label PRs from forks.
5+
# This workflow only runs actions/labeler (no code checkout), so it's safe.
6+
pull_request_target: # zizmor: ignore[dangerous-triggers]
57
types: [opened, reopened, synchronize]
68

79
jobs:
810
labeler:
9-
if: ${{ github.event.pull_request.user.login != 'dependabot[bot]' }} && ${{ github.event.pull_request.user.login != 'pre-commit-ci[bot]' }}
11+
if: ${{ github.event.pull_request.user.login != 'dependabot[bot]' && github.event.pull_request.user.login != 'pre-commit-ci[bot]' }}
1012
permissions:
1113
contents: read
1214
pull-requests: write

.github/workflows/nightly_wheels.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ jobs:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
- uses: actions/checkout@v6
18+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1919
with:
2020
submodules: true
2121
fetch-depth: 0
22+
persist-credentials: false
2223

23-
- uses: actions/setup-python@v6
24+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2425
name: Install Python
2526
with:
2627
python-version: '3.13'
@@ -37,4 +38,6 @@ jobs:
3738
uses: scientific-python/upload-nightly-action@5748273c71e2d8d3a61f3a11a16421c8954f9ecf
3839
with:
3940
artifacts_path: dist
40-
anaconda_nightly_upload_token: ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }}
41+
# ANACONDA_ORG_UPLOAD_TOKEN is scoped to nightly uploads only.
42+
# Using an environment would add unnecessary approval gates to scheduled builds.
43+
anaconda_nightly_upload_token: ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }} # zizmor: ignore[secrets-outside-env]

.github/workflows/releases.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ jobs:
2323
fail-fast: false
2424

2525
steps:
26-
- uses: actions/checkout@v6
26+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2727
with:
2828
submodules: true
2929
fetch-depth: 0
30+
persist-credentials: false
3031

31-
- uses: actions/setup-python@v6
32+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
3233
name: Install Python
3334
with:
3435
python-version: '3.11'
@@ -39,7 +40,7 @@ jobs:
3940
version: '1.16.5'
4041
- name: Build wheel and sdist
4142
run: hatch build
42-
- uses: actions/upload-artifact@v7
43+
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
4344
with:
4445
name: releases
4546
path: dist
@@ -48,7 +49,7 @@ jobs:
4849
needs: [build_artifacts]
4950
runs-on: ubuntu-latest
5051
steps:
51-
- uses: actions/download-artifact@v7
52+
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
5253
with:
5354
name: releases
5455
path: dist
@@ -70,13 +71,13 @@ jobs:
7071
attestations: write
7172
artifact-metadata: write
7273
steps:
73-
- uses: actions/download-artifact@v7
74+
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
7475
with:
7576
name: releases
7677
path: dist
7778
- name: Generate artifact attestation
78-
uses: actions/attest@v4
79+
uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0
7980
with:
8081
subject-path: dist/*
8182
- name: Publish package to PyPI
82-
uses: pypa/gh-action-pypi-publish@v1.13.0
83+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0

.github/workflows/test.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ jobs:
4545
runs-on: ${{ matrix.os }}
4646

4747
steps:
48-
- uses: actions/checkout@v6
48+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4949
with:
5050
fetch-depth: 0 # grab all branches and tags
51+
persist-credentials: false
5152
- name: Set up Python
52-
uses: actions/setup-python@v6
53+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
5354
with:
5455
python-version: ${{ matrix.python-version }}
5556
cache: 'pip'
@@ -68,9 +69,11 @@ jobs:
6869
hatch env run --env test.py${{ matrix.python-version }}-${{ matrix.dependency-set }} run-coverage
6970
- name: Upload coverage
7071
if: ${{ matrix.dependency-set == 'optional' && matrix.os == 'ubuntu-latest' }}
71-
uses: codecov/codecov-action@v5
72+
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
7273
with:
73-
token: ${{ secrets.CODECOV_TOKEN }}
74+
# CODECOV_TOKEN is a low-sensitivity upload token, not a deploy key.
75+
# Using an environment would gate every test run behind approval/deployment UI.
76+
token: ${{ secrets.CODECOV_TOKEN }} # zizmor: ignore[secrets-outside-env]
7477
verbose: true # optional (default = false)
7578

7679
test-upstream-and-min-deps:
@@ -87,11 +90,12 @@ jobs:
8790
- python-version: "3.11"
8891
dependency-set: upstream
8992
steps:
90-
- uses: actions/checkout@v6
93+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
9194
with:
9295
fetch-depth: 0
96+
persist-credentials: false
9397
- name: Set up Python
94-
uses: actions/setup-python@v6
98+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
9599
with:
96100
python-version: ${{ matrix.python-version }}
97101
cache: 'pip'
@@ -107,20 +111,23 @@ jobs:
107111
run: |
108112
hatch env run --env ${{ matrix.dependency-set }} run-coverage
109113
- name: Upload coverage
110-
uses: codecov/codecov-action@v5
114+
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
111115
with:
112-
token: ${{ secrets.CODECOV_TOKEN }}
116+
# CODECOV_TOKEN is a low-sensitivity upload token, not a deploy key.
117+
# Using an environment would gate every test run behind approval/deployment UI.
118+
token: ${{ secrets.CODECOV_TOKEN }} # zizmor: ignore[secrets-outside-env]
113119
verbose: true # optional (default = false)
114120

115121
doctests:
116122
name: doctests
117123
runs-on: ubuntu-latest
118124
steps:
119-
- uses: actions/checkout@v6
125+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
120126
with:
121127
fetch-depth: 0 # required for hatch version discovery, which is needed for numcodecs.zarr3
128+
persist-credentials: false
122129
- name: Set up Python
123-
uses: actions/setup-python@v6
130+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
124131
with:
125132
python-version: '3.13'
126133
cache: 'pip'

0 commit comments

Comments
 (0)