I have a workflow that I want to trigger on GitHub as an action every 15 minutes.
I have used cron-jobs to schedule it. But it’s not getting triggered.
I checked it on other events like push
and it’s working.
Adding my .yml file below:-
name: Temp Workflow
on:
schedule:
- cron: "*/15 * * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
ref: branch_123
- name: Hello World
run: echo "Hello, World!"
- name: Hi world
run: echo "Hii, World!"
env:
CI: true
At first I want to run it on branch_123 to test and after testing will do it for master branch.
2
Answers
According to the official documentation, those
cron
runs only trigger if the workflow is on the repositorydefault
branch.Also, note that the schedule event can be delayed during periods of high loads of GitHub Actions workflow runs. High load times include the start of every hour. If the load is sufficiently high enough, some queued jobs may be dropped. To decrease the chance of delay, schedule your workflow to run at a different time of the hour.
This feature is only for the
default
branch as of now, Refer the snippet belowHowever, you may still reach out to
actions community
– https://github.com/orgs/community/discussionsYour suggestion might result into a new feature.