diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index ae4820e4..c604b2a9 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -9,20 +9,26 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +permissions: {} + env: CARGO_TERM_COLOR: always jobs: coverage: runs-on: ubuntu-latest + permissions: + contents: read steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false - uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4 - run: rustup update stable - run: rustup component add llvm-tools-preview --toolchain stable-x86_64-unknown-linux-gnu - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 - name: Install cargo-llvm-cov - uses: taiki-e/install-action@4c7e9f3bb4ca35f54341be8fc8d3608f71e4d24e # cargo-llvm-cov + uses: taiki-e/install-action@4c7e9f3bb4ca35f54341be8fc8d3608f71e4d24e # zizmor: ignore[impostor-commit] cargo-llvm-cov (tag-only ref by design) - name: Install shells for completion integration tests run: | sudo apt-get update diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 29c5c412..676f86bb 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -9,11 +9,7 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write +permissions: {} # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. @@ -25,11 +21,14 @@ jobs: # Build job build: runs-on: ubuntu-latest + permissions: + contents: read steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: fetch-depth: 0 # Not needed if lastUpdated is not enabled + persist-credentials: false - uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4 - name: Setup Pages uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6 diff --git a/.github/workflows/publish-cli.yml b/.github/workflows/publish-cli.yml index 5689d2b0..5a06bdf0 100644 --- a/.github/workflows/publish-cli.yml +++ b/.github/workflows/publish-cli.yml @@ -1,7 +1,6 @@ name: publish-cli -permissions: - contents: write +permissions: {} on: push: @@ -21,16 +20,21 @@ env: jobs: create-release: runs-on: ubuntu-latest + permissions: + contents: write steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: submodules: recursive fetch-depth: 0 + persist-credentials: false - uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4 + with: + cache: false - name: Create draft release if: ${{ startsWith(github.ref, 'refs/tags/v') }} run: | - TAG_NAME="${{ github.ref_name }}" + TAG_NAME="${GITHUB_REF_NAME}" awk '/^## \[/{if(found) exit; found=1} found{print}' CHANGELOG.md >/tmp/release-notes.txt BODY=$(cat /tmp/release-notes.txt) # GitHub may not have indexed the tag yet after a push. Draft releases @@ -83,14 +87,18 @@ jobs: os: windows-latest build-tool: cargo runs-on: ${{ matrix.os }} + permissions: + contents: write steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: submodules: recursive + persist-credentials: false - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable - uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4 with: experimental: true + cache: false - if: matrix.os == 'macos-latest' uses: apple-actions/import-codesign-certs@5142e029c445c10ffc7149d172e540235a065466 # v7 with: @@ -114,24 +122,34 @@ jobs: runs-on: ubuntu-latest needs: [build-and-publish] if: ${{ startsWith(github.ref, 'refs/tags/v') }} + permissions: + contents: write steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: submodules: recursive + persist-credentials: false - uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4 - - run: gh release edit ${{ github.ref_name }} --draft=false + with: + cache: false + - run: gh release edit "${GITHUB_REF_NAME}" --draft=false if: ${{ github.event_name != 'workflow_dispatch' }} enhance-release: runs-on: ubuntu-latest needs: [release] if: ${{ startsWith(github.ref, 'refs/tags/v') }} + permissions: + contents: write steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: submodules: recursive fetch-depth: 0 + persist-credentials: false - uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4 - - run: communique generate "${{ github.ref_name }}" --github-release + with: + cache: false + - run: communique generate "${GITHUB_REF_NAME}" --github-release env: ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} - name: Append en.dev sponsor blurb diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml index 5dd416b4..00f54139 100644 --- a/.github/workflows/release-plz.yml +++ b/.github/workflows/release-plz.yml @@ -27,9 +27,11 @@ jobs: fetch-depth: 0 submodules: recursive token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} + persist-credentials: false - uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4 with: experimental: true + cache: false - run: mise trust --all - run: mise run release-plz env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 30537546..4d226215 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,6 +8,8 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +permissions: {} + env: MISE_EXPERIMENTAL: 1 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -15,10 +17,13 @@ env: jobs: test: runs-on: ubuntu-latest + permissions: + contents: read steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: submodules: recursive + persist-credentials: false - uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 with: shared-key: test diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml new file mode 100644 index 00000000..f78b23fc --- /dev/null +++ b/.github/workflows/zizmor.yml @@ -0,0 +1,21 @@ +name: zizmor +on: + push: + branches: [main] + pull_request: + paths: [".github/workflows/**"] + +permissions: {} + +jobs: + zizmor: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false + - uses: zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e # v0.5.3 + with: + advanced-security: false