Skip to content

Commit 3849578

Browse files
Run Zizmor linting on core actions (#19)
1 parent a9aee67 commit 3849578

4 files changed

Lines changed: 23 additions & 11 deletions

File tree

.github/workflows/test.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,37 +51,37 @@ jobs:
5151
# Test OS values with fixed test-folder and pixi-version
5252
- os: ubuntu-latest
5353
test-folder: just-pixi-toml
54-
expected-hash: "pixi-lock__69110db0bf39d7ce64fd774c7078ccd56ebf8542d9a1e86f84e63011634dc43f_2026-02-24"
54+
expected-hash: "pixi-lock__69110db0bf39d7ce64fd774c7078ccd56ebf8542d9a1e86f84e63011634dc43f_{TODAYS_DATE}"
5555
pixi-version: ""
5656
- os: macos-latest
5757
test-folder: just-pixi-toml
58-
expected-hash: "pixi-lock__69110db0bf39d7ce64fd774c7078ccd56ebf8542d9a1e86f84e63011634dc43f_2026-02-24"
58+
expected-hash: "pixi-lock__69110db0bf39d7ce64fd774c7078ccd56ebf8542d9a1e86f84e63011634dc43f_{TODAYS_DATE}"
5959
pixi-version: ""
6060
- os: windows-latest
6161
test-folder: just-pixi-toml
62-
expected-hash: "pixi-lock__adbacdefe20c62f204989acf366ef09911f3af89f066088613341b946be131e8_2026-02-24"
62+
expected-hash: "pixi-lock__adbacdefe20c62f204989acf366ef09911f3af89f066088613341b946be131e8_{TODAYS_DATE}"
6363
pixi-version: ""
6464
# Test test-folder values with fixed OS and pixi-version
6565
- os: ubuntu-latest
6666
test-folder: just-pixi-toml
67-
expected-hash: "pixi-lock__69110db0bf39d7ce64fd774c7078ccd56ebf8542d9a1e86f84e63011634dc43f_2026-02-24"
67+
expected-hash: "pixi-lock__69110db0bf39d7ce64fd774c7078ccd56ebf8542d9a1e86f84e63011634dc43f_{TODAYS_DATE}"
6868
pixi-version: ""
6969
- os: ubuntu-latest
7070
test-folder: just-pyproject-toml
71-
expected-hash: "pixi-lock__4a057faded2062ff018955c0be1db1b9e1d2fb8d1fe4303d8b778af7fd9e411d_2026-02-24"
71+
expected-hash: "pixi-lock__4a057faded2062ff018955c0be1db1b9e1d2fb8d1fe4303d8b778af7fd9e411d_{TODAYS_DATE}"
7272
pixi-version: ""
7373
- os: ubuntu-latest
7474
test-folder: pyproject-and-pixi-toml
75-
expected-hash: "pixi-lock__b5bae43771086cb1dd79c43dc06881f8b0e006ad8c54e7269dad1a4f8ce96522_2026-02-24"
75+
expected-hash: "pixi-lock__b5bae43771086cb1dd79c43dc06881f8b0e006ad8c54e7269dad1a4f8ce96522_{TODAYS_DATE}"
7676
pixi-version: ""
7777
# Test pixi-version values with fixed OS and test-folder
7878
- os: ubuntu-latest
7979
test-folder: just-pixi-toml
80-
expected-hash: "pixi-lock__69110db0bf39d7ce64fd774c7078ccd56ebf8542d9a1e86f84e63011634dc43f_2026-02-24"
80+
expected-hash: "pixi-lock__69110db0bf39d7ce64fd774c7078ccd56ebf8542d9a1e86f84e63011634dc43f_{TODAYS_DATE}"
8181
pixi-version: ""
8282
- os: ubuntu-latest
8383
test-folder: just-pixi-toml
84-
expected-hash: "pixi-lock_v0.63.2_69110db0bf39d7ce64fd774c7078ccd56ebf8542d9a1e86f84e63011634dc43f_2026-02-24"
84+
expected-hash: "pixi-lock_v0.63.2_69110db0bf39d7ce64fd774c7078ccd56ebf8542d9a1e86f84e63011634dc43f_{TODAYS_DATE}"
8585
pixi-version: "v0.63.2"
8686
steps:
8787
- name: Checkout repository
@@ -104,6 +104,7 @@ jobs:
104104
run: |
105105
actual_hash="${{ steps.create-and-cache.outputs.cache-key }}"
106106
expected_hash="${{ matrix.expected-hash }}"
107+
expected_hash="${expected_hash/\{TODAYS_DATE\}/$(date +%Y-%m-%d)}"
107108
echo "Expected hash: $expected_hash"
108109
echo "Actual hash: $actual_hash"
109110
if [ "$actual_hash" != "$expected_hash" ]; then

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ repos:
99
- id: check-json
1010
types: [text]
1111
files: \.(json|ipynb)$
12+
# - repo: https://github.com/zizmorcore/zizmor-pre-commit
13+
# rev: v1.23.1
14+
# hooks:
15+
# - id: zizmor
1216
- repo: https://github.com/rbubley/mirrors-prettier # Update mirror as official mirror is deprecated
1317
rev: v3.6.2
1418
hooks:

create-and-cache/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,12 @@ runs:
2727
- name: Get cache key
2828
id: cache-key
2929
shell: bash
30+
env:
31+
PIXI_VERSION: ${{ inputs.pixi-version }}
32+
HASH_FILES: ${{ hashFiles(inputs.hash-files) }}
3033
run: |
3134
today=$(date +'%Y-%m-%d')
32-
key="pixi-lock_${{ inputs.pixi-version }}_${{ hashFiles(inputs.hash-files) }}_${today}"
35+
key="pixi-lock_${PIXI_VERSION}_${HASH_FILES}_${today}"
3336
echo "key=${key}" >> "$GITHUB_OUTPUT"
3437
3538
- name: Restore pixi.lock from cache

restore/action.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,21 @@ runs:
1111
steps:
1212
- name: Check cache-key
1313
shell: bash
14+
env:
15+
CACHE_KEY: ${{ inputs.cache-key }}
1416
run: |
15-
if [[ -z "${{ inputs.cache-key }}" ]]; then
17+
if [[ -z "${CACHE_KEY}" ]]; then
1618
echo "::error::cache-key cannot be an empty string"
1719
exit 1
1820
fi
1921
2022
- name: Calculate fallback key
2123
id: fallback
2224
shell: bash
25+
env:
26+
CACHE_KEY: ${{ inputs.cache-key }}
2327
run: |
24-
cache_key="${{ inputs.cache-key }}"
28+
cache_key="${CACHE_KEY}"
2529
# Extract base (everything before the last _) and date (after the last _)
2630
base="${cache_key%_*}"
2731
current_date="${cache_key##*_}"

0 commit comments

Comments
 (0)