Skip to content

Commit 3ef2cfd

Browse files
Copilotsxjeru
andauthored
ci: tighten lint workflow permissions and step order
Agent-Logs-Url: https://github.com/sxjeru/CLIProxyAPI-Monitor/sessions/4dead3e2-6fd2-48ee-ac31-a7acb400c2ad Co-authored-by: sxjeru <20513115+sxjeru@users.noreply.github.com>
1 parent e1c834e commit 3ef2cfd

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/lint.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,25 @@ on:
77
- master
88
pull_request:
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
lint:
1215
runs-on: ubuntu-latest
1316
steps:
1417
- name: Checkout
1518
uses: actions/checkout@v4
1619

20+
- name: Setup pnpm
21+
run: corepack enable
22+
1723
- name: Setup Node.js
1824
uses: actions/setup-node@v4
1925
with:
2026
node-version: 22
2127
cache: pnpm
2228

23-
- name: Setup pnpm
24-
run: corepack enable
25-
2629
- name: Install dependencies
2730
run: pnpm install --frozen-lockfile
2831

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- 新增 GitHub Actions `lint` 工作流(`.github/workflows/lint.yml`):
66
-`push``main/master`)与 `pull_request` 触发,统一执行 `pnpm install --frozen-lockfile``pnpm lint`
7+
- 工作流增加 `permissions: contents: read` 最小权限配置,降低默认令牌权限暴露面。
78
- 通过 CI 自动校验代码风格,减少未被本地发现的 lint 问题进入主分支。
89

910
## 2026-04-15

0 commit comments

Comments
 (0)