How to get the target branch of the GitHub pull request from an Actions?

孤者浪人 提交于 2020-12-26 07:41:26

问题


When an action is set on pull_request in Github Actions, how to get the target branch? The use case is to retrieve the PR- (and hopefully, branch)-specific commits.


回答1:


You can access the target branch with ${{ github.event.pull_request.base.ref }}.

To know the full list of properties of the github.event object, try to run more $GITHUB_EVENT_PATH.




回答2:


You can see all GitHub actions pull request event properties here.



来源:https://stackoverflow.com/questions/62331829/how-to-get-the-target-branch-of-the-github-pull-request-from-an-actions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!