From 7d5801c228afcbb0d39ce9bdb1eb14360f1c215b Mon Sep 17 00:00:00 2001 From: Mykhailo Chalyi Date: Fri, 5 Jun 2026 00:40:54 +0000 Subject: [PATCH] chore(ci): pin python workflow actions to commit SHAs Replaces mutable tags (v6, v7, nightly, 1.95.0) with immutable commit SHAs to prevent supply-chain attacks via tag mutation. Fixes #1864. --- .github/workflows/python.yml | 40 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index e7866d8a..043a9778 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -40,9 +40,9 @@ jobs: name: Lint & Format runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - - uses: astral-sh/setup-uv@v7 + - uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7 - name: Ruff check run: uvx ruff check crates/bashkit-python @@ -50,7 +50,7 @@ jobs: - name: Ruff format run: uvx ruff format --check crates/bashkit-python - - uses: actions/setup-python@v6 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 with: python-version: "3.12" @@ -67,16 +67,16 @@ jobs: matrix: python-version: ["3.9", "3.12", "3.13", "3.14"] steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - - uses: actions/setup-python@v6 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 with: python-version: ${{ matrix.python-version }} - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@1.95.0 + uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0 - - uses: Swatinem/rust-cache@v2 + - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 - name: Install maturin run: python -m pip install "maturin${MATURIN_VERSION}" @@ -105,18 +105,18 @@ jobs: name: Examples runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - - uses: actions/setup-python@v6 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 with: python-version: "3.12" - - uses: astral-sh/setup-uv@v7 + - uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7 - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@1.95.0 + uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0 - - uses: Swatinem/rust-cache@v2 + - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 - name: Install maturin run: python -m pip install "maturin${MATURIN_VERSION}" @@ -157,9 +157,9 @@ jobs: name: Build wheel runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - - uses: actions/setup-python@v6 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 with: python-version: "3.12" @@ -175,7 +175,7 @@ jobs: pip install twine twine check crates/bashkit-python/dist/* - - uses: actions/upload-artifact@v7 + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: name: python-wheel path: crates/bashkit-python/dist @@ -196,12 +196,12 @@ jobs: RUST_NIGHTLY: "nightly-2026-05-29" PYODIDE_BUILD_VERSION: "0.34.4" steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 # Python 3.13 selects pyodide-build's modern config (Pyodide 0.29.x, # Emscripten 4.0.9), whose binaryen understands the wasm target-features # modern LLVM emits and whose runtime supports wasm exception handling. - - uses: actions/setup-python@v6 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 with: python-version: "3.13" @@ -213,12 +213,12 @@ jobs: - name: Install nightly Rust with the Emscripten target # @nightly matches the repo's other nightly jobs (fuzz.yml, nightly.yml, # ci.yml); the exact nightly is pinned via the toolchain: input below. - uses: dtolnay/rust-toolchain@nightly + uses: dtolnay/rust-toolchain@5b842231ba77f5c045dba54ac5560fed2db780e2 # nightly with: toolchain: ${{ env.RUST_NIGHTLY }} targets: wasm32-unknown-emscripten - - uses: Swatinem/rust-cache@v2 + - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 # pyodide-build manages its own matching emsdk via the cross-build env, so # no separate setup-emsdk step is needed. @@ -260,7 +260,7 @@ jobs: print('wasm smoke test OK') " - - uses: actions/upload-artifact@v7 + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: name: python-wheel-emscripten path: crates/bashkit-python/dist