You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.30 00:02:10