Github 表示有效的现有工作“正在等待状态报告”

day*_*mer 1 github github-actions

我有一个 PR,我希望在合并到 master 之前完成某些检查。这是工作 https://github.com/hhimanshu/typescript-serverless-api-vercel/actions/runs/763599870

现在,在 PR 中,没有报告其状态。这是公关

https://github.com/hhimanshu/typescript-serverless-api-vercel/pull/4

我在https://github.community/t/expected-waiting-for-status-to-be-reported/18001上查看了过去提出的类似问题,但是,该问题中出现此问题的原因是

在大多数情况下,这是因为您从工作流程中删除了作业或更改了作业(重命名),但没有更新分支规则。

但就我而言,作业名称相同,并且作业也没有删除,因此该解决方案不适用。

我的分支保护规则将此工作设置为“必需” 在此输入图像描述

有人可以帮我理解我在这里做错了什么吗?

day*_*mer 6

我需要的是一种更新方式status使用 Github REST API 进行更新的方法。

\n
# We must set the commit status manually\n      # Reference: https://github.com/bahmutov/eleventy-example/blob/main/.github/workflows/ci.yml#L27\n      - name: Staging Tests \xe2\x9c\x85\n        if: ${{ success() }}\n        # set the merge commit status check\n        # using GitHub REST API\n        # see https://docs.github.com/en/rest/reference/repos#create-a-commit-status\n        run: |\n          curl --request POST \\\n          --url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }} \\\n          --header \'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}\' \\\n          --header \'content-type: application/json\' \\\n          --data \'{\n            "context": "Staging Tests",\n            "state": "success",\n            "description": "Staging tests passed",\n            "target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"\n          }\'\n      - name: Staging Tests \n        if: ${{ failure() }}\n        # set the merge commit status check\n        # using GitHub REST API\n        # see https://docs.github.com/en/rest/reference/repos#create-a-commit-status\n        run: |\n          curl --request POST \\\n          --url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }} \\\n          --header \'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}\' \\\n          --header \'content-type: application/json\' \\\n          --data \'{\n            "context": "Staging Tests",\n            "state": "failure",\n            "description": "Staging tests failed",\n            "target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"\n          }\'\n
Run Code Online (Sandbox Code Playgroud)\n

之后,PR 在检查中显示链接。链接是https://github.com/hhimanshu/typescript-serverless-api-vercel/pull/4

\n

我在使用https://glebbahmutov.com/blog/develop进行工作时从https://github.com/bahmutov/eleventy-example/blob/main/.github/workflows/ci.yml#L27了解到这一点-预览测试/

\n

此后,我看到状态按预期更新,并带有一个链接,可将我带到该工作

\n

在此输入图像描述

\n

我希望这也对其他人有帮助

\n