Skip to content

Commit 52e4671

Browse files
author
perlinson
committed
🔧 fix: 优化 GitHub Pages 部署权限配置
✨ 权限优化: - 在 deploy job 中添加精确的权限设置 - pages: write - 允许部署到 GitHub Pages - id-token: write - 验证部署来源的适当性 - environment 名称改为 gh-pages 🔧 技术改进: - 更细粒度的权限控制 - 遵循 GitHub Pages 最佳实践 - 提高部署安全性和可靠性 🎯 解决问题: - 修复可能的权限不足问题 - 确保部署流程符合最新要求 - 提高部署成功率
1 parent e46f8fe commit 52e4671

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,15 @@ jobs:
5959
# Deployment job
6060
deploy:
6161
environment:
62-
name: github-pages
62+
name: gh-pages
6363
url: ${{ steps.deployment.outputs.page_url }}
64-
runs-on: ubuntu-latest
6564
needs: build
65+
permissions:
66+
pages: write # to deploy to Pages
67+
id-token: write # to verify the deployment originates from an appropriate source
6668
if: github.ref == 'refs/heads/main'
69+
runs-on: ubuntu-latest
6770
steps:
6871
- name: Deploy to GitHub Pages
6972
id: deployment
70-
uses: actions/deploy-pages@v4
73+
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action

0 commit comments

Comments
 (0)