我已经创建了一个操作,我希望它能够在分支foo
上按计划运行(我的情况是每天两次)。
这是目前为止我得到的:
repo/.github/workflows/daily-foo-tests.yml
name: Run integration tests on foo branch twice a day
on:
schedule:
# Execute at 00:01 and 13:01 UTC daily
- cron: '00 01,13 * * *'
jobs:
build:
name: Run UI Automation
runs-on: [self-hosted, macOS, X64]
steps:
- uses: actions/checkout@v2
- name: dotnet build
with: { ref: foo }
// continues to do stuff, not important
现在,此操作已被推送到名为foo
的分支。然而,前往github.com/org/repo/actions
,它不会触发(我已经等了24小时了;在这一点上应该做点什么)。
触发指定分支上预定的github动作工作流的正确方法是什么?
foo
是存储库的staging
分支,而master
是默认分支 - 工作流yaml必须存在于master
分支上才能触发任何操作吗?我不希望它在默认分支上运行最新的提交SHA;我想要的是foo
分支上的最新提交SHA。 - cbllon: schedule
工作流在非默认分支中不起作用。但是当它运行时,您仍然可以检出其他分支。 - peterevans