【问题标题】:GitHub Actions `HttpError: Not Found` when initializing new deployment for develop @ refs/heads/developGitHub Actions `HttpError: Not Found` 在为 develop @ refs/heads/develop 初始化新部署时
【发布时间】:2023-02-14 18:13:38
【问题描述】:

我有一个 GitHub 存储库(我们称它为my-repo),设置了 GitHub Actions 并包含相应的 .github/workflows/files.yml,并正确链接到 Vercel。当我的部署操作运行时,它失败并显示 HttpError 和此日志:

  1. Run bobheadxi/deployments@v1

  2. targeting my-GitHub/my-repo

  3. initializing new deployment for develop @ refs/heads/develop

  4. unexpected error encountered: HttpError: Not Found

  5. Error: unexpected error encountered: HttpError: Not Found

    我已经确认 refs/heads/develop 存在于我的 repo 的引用中。

    这是 GitHub Actions 日志的屏幕截图(已启用调试):

    这是我的工作流程代码(失败点是Create Deployment):

    name: Deploy Environment to Vercel
    
    on:
      push:
        branches:
          - develop
          - main
          - release
      workflow_dispatch:
    
    jobs:
    
      deploy_develop:
        name: "Deploy to Develop"
        if: github.ref == 'refs/heads/develop'
        runs-on: mono-runner
        steps:
          - name: Checkout
            uses: actions/checkout@v2
    
      - name: Create Deployment
        uses: bobheadxi/deployments@v1
        id: deployment
        with:
          step: start
          token: ${{ secrets.BUILDBOT_PERSONAL_TOKEN }}
          env: "Develop" 
    
      - name: Vercel Deployment
        uses: amondnet/vercel-action@master
        id: vercel
        with:
          vercel-token: ${{ secrets.BUILDBOT_VERCEL_TOKEN }}
          github-token: ${{ secrets.BUILDBOT_PERSONAL_TOKEN }}
          vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
          vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
          scope: ${{ secrets.VERCEL_ORG_ID }}
    
      - name: Update Deployment
        uses: bobheadxi/deployments@v1
        if: always()
        with:
          step: finish
          token: ${{ secrets.BUILDBOT_PERSONAL_TOKEN }}
          status: ${{ job.status }}
          env: ${{ steps.deployment.outputs.env }}
          deployment_id: ${{ steps.deployment.outputs.deployment_id }}
    

    我已经验证的事情:

    • Vercel 已正确链接到 my-repo GitHub 项目。
    • 创建 GitHub 机密以提供 Vercel 项目 ID + 组织 ID(将 my-repo 项目链接到 Vercel 后在 .vercel 目录中提供的那些)。
    • 我在 my-repo 的 vercel.json 文件中禁用了 Vercel 构建,因此只有 GitHub 在进行构建。

    日志没有提供我能找到的任何其他信息 - 任何建议将不胜感激!!

【问题讨论】:

  • 检查 http 调用 bobheadxi/deployments 的内容。

标签: github-actions vercel


【解决方案1】:

最终的答案是,我设置的 Buildbot 没有将我的秘密正确地输入到我的 GitHub Actions 中。现在秘密已正确配置,相同的代码将部署到 Vercel。

脸掌

【讨论】:

    【解决方案2】:

    大声笑我遇到了同样的问题,这里是工作流文件(workflow.yml)中的修复:

          - name: Run worklow
        env:
          SOME_TOKEN: ${{ secrets.SOME_TOKEN }}
        working-directory: ./directory
        run: run command
    

    【讨论】:

      猜你喜欢
      • 2013-09-05
      • 2021-04-20
      • 2019-10-26
      • 2022-01-28
      • 1970-01-01
      • 2020-10-23
      • 2022-07-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多