在 GitHub 存储库中,我有两个单独的 GitHub Actions 工作流程:
github/workflows/pr.yml只是构建和测试
name: Pull request workflow
on: pull_request
Run Code Online (Sandbox Code Playgroud)
并github/workflows/push.yml构建、测试和部署
name: Push workflow
on: push
Run Code Online (Sandbox Code Playgroud)
创建拉取请求会触发这两个工作流程。
是否无法将它们分开或者我在这里缺少什么?
如果您只部署某些分支,请按Push workflow以下方式进行限制:
name: Push workflow
on:
push:
branches:
- master
Run Code Online (Sandbox Code Playgroud)
另一种选择是排除分支
on:
push:
# Sequence of patterns matched against refs/heads
branches-ignore:
# Push events to branches matching refs/heads/mona/octocat
- 'mona/octocat'
# Push events to branches matching refs/heads/releases/beta/3-alpha
- 'releases/**-alpha'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1764 次 |
| 最近记录: |