Azure部署超时:Post Run actions/checkout@v3步骤无限挂起
解决GitHub Actions部署Angular到Azure静态Web应用时Post Run checkout@v3挂起问题
常见修复方案
调整checkout动作配置:在
actions/checkout@v3中添加参数,避免Post Run阶段因凭证或历史处理卡住- uses: actions/checkout@v3 with: persist-credentials: false fetch-depth: 0若不需要完整仓库历史,可将
fetch-depth设为1,减少Post Run清理负载。修正Azure部署动作的路径配置:确保
azure/static-web-apps-deploy@v1的输出路径匹配Angular构建结果,默认Angular构建输出为dist/[你的项目名称],示例配置:- name: Deploy to Azure Static Web Apps uses: azure/static-web-apps-deploy@v1 with: azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} app_location: "/" output_location: "dist/your-angular-project-name"错误的输出路径可能导致残留进程,间接引发checkout的Post Run挂起。
切换checkout动作版本:尝试升级到
actions/checkout@v4或回退到v2,不同版本的Post Run逻辑差异可能避开当前版本的bug:- uses: actions/checkout@v4手动清理Git锁文件:在部署步骤后添加清理命令,避免Post Run阶段因锁文件无法处理而卡住:
- name: Clean up Git locks run: | rm -rf .git/index.lock rm -rf .git/objects/pack/*.lock
内容的提问来源于stack exchange,提问作者Kushagra
相关产品推荐
相关产品推荐

