From 9db9ab86030e6c08742202feb69fbd5a8a54c847 Mon Sep 17 00:00:00 2001 From: Maintenance Date: Mon, 5 Oct 2026 23:42:23 -0700 Subject: [PATCH] ci: harden workflow permissions and actions --- .github/dependabot.yml | 6 ++++++ .github/workflows/ci.yml | 4 ++-- .github/workflows/codeql.yml | 17 +++++++++-------- 3 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..ca79ca5 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dde6984..e1a0277 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,9 +38,9 @@ jobs: # vitest 4 and jsdom 29 exclude it. node: ['22.22.0', '24.19.0'] steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: ${{ matrix.node }} package-manager-cache: false diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 029906a..fba1d41 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -12,10 +12,7 @@ on: schedule: - cron: "41 10 * * 1" -permissions: - actions: read - contents: read - security-events: write +permissions: {} concurrency: group: codeql-${{ github.ref }} @@ -24,8 +21,12 @@ concurrency: jobs: analyze: name: Analyze (${{ matrix.language }}) - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 timeout-minutes: 10 + permissions: + actions: read + contents: read + security-events: write strategy: fail-fast: false @@ -34,15 +35,15 @@ jobs: steps: - name: Checkout - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Initialize CodeQL - uses: github/codeql-action/init@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 + uses: github/codeql-action/init@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2 with: languages: ${{ matrix.language }} queries: security-extended,security-and-quality - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 + uses: github/codeql-action/analyze@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2 with: category: "/language:${{ matrix.language }}"