【发布时间】:2023-02-24 22:41:20
【问题描述】:
我有一个 GitHub 工作流,当在 Pull Request 中发表评论时触发
if: ${{ github.event.comment.body == '/some_comment'}} && ${{ github.event.issue.pull_request }}
执行工作流时,checkout 操作会克隆 master 分支,而不是 PR 中的实际分支。
- uses: actions/checkout@v3
我尝试了各种输出但没有运气 :( 对于下面的示例,所有回声都是空的。
- run: "echo ${{github.event.pull_request.head.sha}}"
- run: "echo ${{github.event.workflow_run.head.sha}}"
- run: "echo ${{github.event.workflow_run.base.sha}}"
- run: "echo ${{github.event.pull_request.base.sha}}"
你们有谁知道如何在 Github Action 中查看 PR 中的源代码分支吗?
谢谢
【问题讨论】:
标签: git github github-actions branch