给定一个拉取请求的Github Action,我想获得该PR分支的所有提交列表。我可以这样做 git log master..
但在Action中却失败了。
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- run: git log ${{ github.event.pull_request.base.ref }}..
fatal: bad revision 'master'
有什么提示为什么会失败?
这个动作漏掉了一个 git fetch
. 然后可以用 origin/
前缀。
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- run: git fetch
- run: git log origin/${{ github.event.pull_request.base.ref }}..