diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index aa65037caeaac..e71cb3b0e261d 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -40,6 +40,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + persist-credentials: false - uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} @@ -68,6 +69,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + persist-credentials: false - uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} @@ -109,6 +111,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + persist-credentials: false - uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} @@ -164,6 +167,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + persist-credentials: false - uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} @@ -216,6 +220,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + persist-credentials: false - uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} @@ -290,6 +295,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + persist-credentials: false - uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} @@ -354,6 +360,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + persist-credentials: false - uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} @@ -419,6 +426,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + persist-credentials: false - uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index b4ba150656183..c57b3a0c96d04 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -36,6 +36,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + persist-credentials: false - uses: docker/setup-buildx-action@v3 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 92556526f81c7..9d8c157715c9a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,6 +38,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + persist-credentials: false - uses: tj-actions/changed-files@v45 id: changed @@ -99,6 +100,8 @@ jobs: timeout-minutes: 10 steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: "Install Rust toolchain" run: rustup component add rustfmt - run: cargo fmt --all --check @@ -111,6 +114,8 @@ jobs: timeout-minutes: 20 steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: "Install Rust toolchain" run: | rustup component add clippy @@ -129,6 +134,8 @@ jobs: timeout-minutes: 20 steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: "Install Rust toolchain" run: rustup show - name: "Install mold" @@ -173,6 +180,8 @@ jobs: timeout-minutes: 20 steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: "Install Rust toolchain" run: rustup show - name: "Install mold" @@ -200,6 +209,8 @@ jobs: timeout-minutes: 20 steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: "Install Rust toolchain" run: rustup show - name: "Install cargo nextest" @@ -224,6 +235,8 @@ jobs: timeout-minutes: 10 steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: "Install Rust toolchain" run: rustup target add wasm32-unknown-unknown - uses: actions/setup-node@v4 @@ -251,6 +264,8 @@ jobs: timeout-minutes: 20 steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: "Install Rust toolchain" run: rustup show - name: "Install mold" @@ -267,6 +282,8 @@ jobs: timeout-minutes: 20 steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - uses: SebRollen/toml-action@v1.2.0 id: msrv with: @@ -299,6 +316,8 @@ jobs: timeout-minutes: 10 steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: "Install Rust toolchain" run: rustup show - uses: Swatinem/rust-cache@v2 @@ -325,6 +344,8 @@ jobs: FORCE_COLOR: 1 steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - uses: astral-sh/setup-uv@v4 - uses: actions/download-artifact@v4 name: Download Ruff binary to test @@ -355,6 +376,8 @@ jobs: timeout-minutes: 5 steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: "Install Rust toolchain" run: rustup component add rustfmt - uses: Swatinem/rust-cache@v2 @@ -379,6 +402,8 @@ jobs: timeout-minutes: 20 steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} @@ -489,6 +514,8 @@ jobs: if: ${{ needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }} steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - uses: cargo-bins/cargo-binstall@main - run: cargo binstall --no-confirm cargo-shear - run: cargo shear @@ -499,6 +526,8 @@ jobs: timeout-minutes: 20 steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} @@ -524,6 +553,8 @@ jobs: timeout-minutes: 10 steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} @@ -555,6 +586,8 @@ jobs: MKDOCS_INSIDERS_SSH_KEY_EXISTS: ${{ secrets.MKDOCS_INSIDERS_SSH_KEY != '' }} steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - uses: actions/setup-python@v5 with: python-version: "3.13" @@ -595,6 +628,8 @@ jobs: timeout-minutes: 10 steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: "Install Rust toolchain" run: rustup show - name: "Cache rust" @@ -622,6 +657,7 @@ jobs: - uses: actions/checkout@v4 name: "Download ruff-lsp source" with: + persist-credentials: false repository: "astral-sh/ruff-lsp" - uses: actions/setup-python@v5 @@ -657,6 +693,8 @@ jobs: steps: - name: "Checkout Branch" uses: actions/checkout@v4 + with: + persist-credentials: false - name: "Install Rust toolchain" run: rustup show diff --git a/.github/workflows/daily_fuzz.yaml b/.github/workflows/daily_fuzz.yaml index e4f31e7790121..a3a4e84d99fa0 100644 --- a/.github/workflows/daily_fuzz.yaml +++ b/.github/workflows/daily_fuzz.yaml @@ -32,6 +32,8 @@ jobs: if: ${{ github.repository == 'astral-sh/ruff' || github.event_name != 'schedule' }} steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - uses: astral-sh/setup-uv@v4 - name: "Install Rust toolchain" run: rustup show diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index fe2dd5edcbbdd..1192d54dcbe82 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -26,6 +26,7 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{ inputs.ref }} + persist-credentials: true - uses: actions/setup-python@v5 with: diff --git a/.github/workflows/publish-playground.yml b/.github/workflows/publish-playground.yml index 8e64c55e50263..648ef1da2ae97 100644 --- a/.github/workflows/publish-playground.yml +++ b/.github/workflows/publish-playground.yml @@ -25,6 +25,8 @@ jobs: CF_API_TOKEN_EXISTS: ${{ secrets.CF_API_TOKEN != '' }} steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: "Install Rust toolchain" run: rustup target add wasm32-unknown-unknown - uses: actions/setup-node@v4 diff --git a/.github/workflows/publish-wasm.yml b/.github/workflows/publish-wasm.yml index c33406f118c75..e2996eca2962d 100644 --- a/.github/workflows/publish-wasm.yml +++ b/.github/workflows/publish-wasm.yml @@ -30,6 +30,8 @@ jobs: fail-fast: false steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - name: "Install Rust toolchain" run: rustup target add wasm32-unknown-unknown - uses: jetli/wasm-pack-action@v0.4.0 diff --git a/.github/workflows/sync_typeshed.yaml b/.github/workflows/sync_typeshed.yaml index 4e74ca645fe22..30a472e02868f 100644 --- a/.github/workflows/sync_typeshed.yaml +++ b/.github/workflows/sync_typeshed.yaml @@ -25,11 +25,13 @@ jobs: name: Checkout Ruff with: path: ruff + persist-credentials: true - uses: actions/checkout@v4 name: Checkout typeshed with: repository: python/typeshed path: typeshed + persist-credentials: true - name: Setup git run: | git config --global user.name typeshedbot diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6b2fd2d14d6b4..3cf893cf5dac1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -88,5 +88,20 @@ repos: - id: prettier types: [yaml] + - repo: https://github.com/woodruffw/zizmor-pre-commit + rev: v0.8.0 + hooks: + - id: zizmor + # `release.yml` is autogenerated by `dist`; security issues need to be fixed there + # (https://opensource.axo.dev/cargo-dist/) + exclude: .github/workflows/release.yml + # We could consider enabling the low-severity warnings, but they're noisy + args: [--min-severity=medium] + + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.29.4 + hooks: + - id: check-github-workflows + ci: skip: [cargo-fmt, dev-generate-all]