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 <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2025-05-06 15:22:08 -07:00
parent 74209b739d
commit 995a39a4cb

35
.github/workflows/scheduled.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
# This enables periodical execution of CI jobs in branches we maintain.
#
# CI jobs are triggered through here (instead of adding "schedule:" to the
# appropriate files) because scheduled jobs are only run on the main branch.
# In other words, it's a way to run periodical CI for other branches.
name: scheduled
on:
schedule:
# Runs at 00:00 UTC every Sunday, Tuesday, Thursday.
- cron: '0 0 * * 0,2,4'
workflow_dispatch:
permissions:
contents: read
actions: write
jobs:
trigger-workflow:
strategy:
matrix:
branch: ["main", "release-1.3"]
wf_id: ["validate.yml", "test.yml"]
runs-on: ubuntu-latest
steps:
- name: Trigger ${{ matrix.wf_id }} workflow on ${{ matrix.branch}} branch
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: '${{ matrix.wf_id }}',
ref: '${{ matrix.branch }}'
});