Sar*_*n S 5 git deployment github-actions
我试图在部署完成后触发我们的冒烟测试。部署可以通过任何平台(如 vercel、GitHub 等)完成。我正在侦听deployment_status来自 GitHub 操作的事件,如果是success,我会根据 获取 PR 详细信息github.sha。代码如下:
name: Run Cypress Smoke Tests
on: [deployment_status]
....
steps:
- name: GitHub API Request
uses: octokit/request-action@v2.x
id: octokit
with:
route: GET /repos/:repository/commits/:commit_sha/pulls
mediaType: |
previews:
- antiope
- groot-preview
repository: ${{ github.repository }}
commit_sha: ${{github.sha}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Run Code Online (Sandbox Code Playgroud)
但有时github.sha并不正确。我从合并分支获取提交 ID 的值,而不是如上所述的实际存储库https://github.community/t/github-sha-not-the-same-as-the-triggering-commit/18286/2。
如何获取活动的正确分支名称或 PR 编号或提交 ID deployment_status?
提前致谢。
| 归档时间: |
|
| 查看次数: |
445 次 |
| 最近记录: |