-
Notifications
You must be signed in to change notification settings - Fork 296
chore: ci #2690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: ci #2690
Changes from all commits
2c93463
a59ebff
0dd3874
6689ea3
a6ab8df
e463e5e
f534e53
5541d2c
43994be
5fc49ec
6d39b5d
0ae20d3
da3caff
f05f54f
5816d7a
7297370
6686ca0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,31 +4,39 @@ on: | |
| push: | ||
| branches: | ||
| - next | ||
|
|
||
| - V3.0 | ||
| pull_request: | ||
| branches: | ||
| - next | ||
|
|
||
| - V3.0 | ||
| pull_request_target: | ||
| types: [opened, synchronize, reopened] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: write-all | ||
|
|
||
| jobs: | ||
| label: | ||
| add-label: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification 需要更新 GitHub Token 配置 工作流程中仍在使用
🔗 Analysis chain请确认访问令牌的使用! 标签添加任务的改进很好,但有以下几点需要注意:
建议验证令牌权限是否满足需求: Also applies to: 24-32, 35-40 Let me check the actual token usage in these files. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# 检查工作流程中的令牌使用情况
rg -l "GITHUB_TOKEN|PERSONAL_ACCESS_TOKEN" .github/workflows/
Length of output: 122 Script: #!/bin/bash
# Check token usage in workflow files
rg "GITHUB_TOKEN|PERSONAL_ACCESS_TOKEN" .github/workflows/ -A 2 -B 2
Length of output: 682 |
||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Check out the repository | ||
| - name: Check out repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Determine label | ||
| id: determine_label | ||
| - name: Determine label based on target branch | ||
| id: determine-label | ||
| run: | | ||
| echo "${{github.event_name}}" | ||
| if [[ "${{ github.event.pull_request.base.ref }}" == "next" ]]; then | ||
| echo "label=2.x" >> $GITHUB_ENV | ||
| elif [[ "${{ github.event.pull_request.base.ref }}" == "V3.0" ]]; then | ||
| echo "label=3.x" >> $GITHUB_ENV | ||
| else | ||
| echo "label=" >> $GITHUB_ENV | ||
| fi | ||
|
|
||
| - name: Add label to PR | ||
| - name: Add label to Pull Request | ||
| if: github.event_name == 'pull_request_target' && env.label != '' | ||
| uses: actions-ecosystem/action-add-labels@v1 | ||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要加强工作流程的安全性配置
当前配置存在以下安全隐患:
pull_request_target触发器可能导致恶意 PR 中的代码在具有仓库权限的环境中执行permissions: write-all权限过于宽泛,违反最小权限原则建议进行如下修改:
📝 Committable suggestion