Skip to content

Commit 995a39a

Browse files
committed
ci: add scheduled run of GHA CI
This is to ensure that our CI is not rotting away even if there are no new PRs or merges. This is especially useful for release branches which tend to cease working over time due to some external reasons. Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent 74209b7 commit 995a39a

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/scheduled.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This enables periodical execution of CI jobs in branches we maintain.
2+
#
3+
# CI jobs are triggered through here (instead of adding "schedule:" to the
4+
# appropriate files) because scheduled jobs are only run on the main branch.
5+
# In other words, it's a way to run periodical CI for other branches.
6+
7+
name: scheduled
8+
on:
9+
schedule:
10+
# Runs at 00:00 UTC every Sunday, Tuesday, Thursday.
11+
- cron: '0 0 * * 0,2,4'
12+
workflow_dispatch:
13+
permissions:
14+
contents: read
15+
actions: write
16+
17+
jobs:
18+
trigger-workflow:
19+
strategy:
20+
matrix:
21+
branch: ["main", "release-1.3"]
22+
wf_id: ["validate.yml", "test.yml"]
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Trigger ${{ matrix.wf_id }} workflow on ${{ matrix.branch}} branch
26+
uses: actions/github-script@v7
27+
with:
28+
github-token: ${{ secrets.GITHUB_TOKEN }}
29+
script: |
30+
await github.rest.actions.createWorkflowDispatch({
31+
owner: context.repo.owner,
32+
repo: context.repo.repo,
33+
workflow_id: '${{ matrix.wf_id }}',
34+
ref: '${{ matrix.branch }}'
35+
});

0 commit comments

Comments
 (0)