我正在尝试设置一个GitHub操作,用于打开或关闭拉请求,并且我希望获得触发器的类型,以便将其添加到消息中。“青年反洗钱法”如下:
on:
pull_request:
types: [opened, closed, reopened] #I’d like to get which one has been triggered例如:
用户X打开了一个拉请求
有人建议${{env.GITHUB_EVENT_NAME}},但它是空的。${{github.event}}似乎是一个不错的地方,但它返回一个带有web钩子有效负载的对象,我不知道其中是否有“type”,也不知道如何获得它。
发布于 2020-05-20 08:31:04
${{github.event.action}}应该为您的拉请求提供操作。
示例:
on:
pull_request:
types: [opened, closed, reopened]
jobs:
prJob:
name: Print info
runs-on: ubuntu-latest
steps:
- name: Print GitHub event action
run: |
echo "${{ github.event.action }}"github上下文记录在https://docs.github.com/en/actions/learn-github-actions/contexts#github-context上。事件的完整文档可以在这里找到:https://developer.github.com/webhooks/event-payloads/#pull_request
https://stackoverflow.com/questions/61886993
复制相似问题