From 53a09718268cb278224b3774efd3cdaff41e84b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9D=A4=E6=98=AF=E7=BA=B1=E9=9B=BE=E9=85=B1=E5=93=9F?= =?UTF-8?q?=EF=BD=9E?= <49941141+Dragon1573@users.noreply.github.com> Date: Sun, 19 Jul 2026 18:15:27 +0800 Subject: [PATCH] chore(ci): Explicitly limit token permissions (#7519) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Explicitly set permission boundaries for `GITHUB_TOKEN` - Prevent overly permissive default tokens Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> --- .github/workflows/autobuild-check-test.yml | 3 +++ .github/workflows/cargo-audit.yml | 3 +++ .github/workflows/frontend-check.yml | 3 +++ .github/workflows/lint-clippy.yml | 2 ++ .github/workflows/rustfmt.yml | 3 +++ 5 files changed, 14 insertions(+) diff --git a/.github/workflows/autobuild-check-test.yml b/.github/workflows/autobuild-check-test.yml index e65c16d8a..92cce80cb 100644 --- a/.github/workflows/autobuild-check-test.yml +++ b/.github/workflows/autobuild-check-test.yml @@ -3,6 +3,9 @@ name: Autobuild Check Logic Test on: workflow_dispatch: +permissions: + contents: read + jobs: check_autobuild_logic: name: Check Autobuild Should Run Logic diff --git a/.github/workflows/cargo-audit.yml b/.github/workflows/cargo-audit.yml index 4437a8e6e..ec2f84c64 100644 --- a/.github/workflows/cargo-audit.yml +++ b/.github/workflows/cargo-audit.yml @@ -3,6 +3,9 @@ name: Cargo Audit on: workflow_dispatch: +permissions: + contents: read + env: HUSKY: 0 diff --git a/.github/workflows/frontend-check.yml b/.github/workflows/frontend-check.yml index d2049766e..7db2f07ec 100644 --- a/.github/workflows/frontend-check.yml +++ b/.github/workflows/frontend-check.yml @@ -4,6 +4,9 @@ on: pull_request: workflow_dispatch: +permissions: + contents: read + env: HUSKY: 0 diff --git a/.github/workflows/lint-clippy.yml b/.github/workflows/lint-clippy.yml index 265b69051..6a5499bf1 100644 --- a/.github/workflows/lint-clippy.yml +++ b/.github/workflows/lint-clippy.yml @@ -5,6 +5,8 @@ on: workflow_dispatch: env: HUSKY: 0 +permissions: + contents: read jobs: clippy: diff --git a/.github/workflows/rustfmt.yml b/.github/workflows/rustfmt.yml index 84f36ab68..54729e285 100644 --- a/.github/workflows/rustfmt.yml +++ b/.github/workflows/rustfmt.yml @@ -7,6 +7,9 @@ name: Check Formatting on: pull_request: +permissions: + contents: read + env: HUSKY: 0