gvl*_*sov 12 github-actions building-github-actions github-actions-workflows
我有一个启动的 Github Actions 工作流程:
on:
pull_request:
types:
- synchronize
- opened
Run Code Online (Sandbox Code Playgroud)
运行我的自定义操作:
jobs:
my_job:
uses: "org/repo/.github/workflows/main.yml@master"
Run Code Online (Sandbox Code Playgroud)
在操作中org/repo,我想在打开拉取请求时执行额外的操作,但不在同步时执行。所以我这样org/repo/.github/workflows/main.yml做:
- if: ${{ condition }}
name: Do that additional thing
Run Code Online (Sandbox Code Playgroud)
应该如何condition区分新打开的拉取请求事件和“同步”事件(推送新提交等)?我想这将涉及检查一些内容,但我在文档${{ github.event.pull_request }}中找不到它。
gvl*_*sov 18
条件是:
- if: ${{ github.event_name == 'pull_request' && github.event.action == 'opened' }}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6347 次 |
| 最近记录: |