Skip to content

Commit 890b310

Browse files
authored
Update main.yml
1 parent f648f68 commit 890b310

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

.github/workflows/main.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,23 @@ on:
3333
- 'true'
3434
- 'false'
3535

36+
# 添加工作流级别的权限
37+
permissions:
38+
contents: write
39+
3640
jobs:
3741
Make:
3842
runs-on: ubuntu-latest
43+
# 添加作业级别的权限(双重保障)
44+
permissions:
45+
contents: write
46+
actions: read
47+
id-token: write
48+
3949
env:
4050
WORKSPACE: ${{ github.workspace }}
4151
BUILD_DATE: $(date +'%Y%m%d')
52+
4253
steps:
4354
- name: 检出当前仓库
4455
uses: actions/checkout@v4
@@ -121,7 +132,11 @@ jobs:
121132
echo "补丁生成完成"
122133
echo "ZIP文件: ${{ steps.create_zip.outputs.zip_name }}"
123134
if [ "${{ github.event.inputs.create_release }}" = "true" ]; then
124-
echo "GitHub Release 已创建: ${{ steps.create_release.outputs.url }}"
135+
if [ "${{ steps.create_release.conclusion }}" = "success" ]; then
136+
echo "GitHub Release 已创建: ${{ steps.create_release.outputs.url }}"
137+
else
138+
echo "GitHub Release 创建失败,请检查权限设置"
139+
fi
125140
else
126141
echo "可在工作流产物中下载补丁文件"
127142
fi

0 commit comments

Comments
 (0)