-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
GitHub Actions Scheduled Workflow Bug Report
Describe the bug
Scheduled workflow runs fire with a stale github.event.schedule cron expression
that no longer exists in the workflow file. The scheduler's internal state does not
sync with the updated workflow YAML on the default branch, causing runs to receive
an outdated cron string.
To Reproduce
-
Create a workflow on the default branch with a schedule trigger:
on: schedule: - cron: '*/5 * * * *' # every five minute
-
Merge it. Confirm scheduled runs fire with
github.event.schedule=*/5 * * * *. -
Update the cron expression and push to the default branch:
on: schedule: - cron: '*/10 * * * *' # every 10 minutes
-
Wait for the next scheduled trigger.
-
Observe that
github.event.schedulestill evaluates to*/5 * * * *(the old
expression), not*/10 * * * *.
Expected behavior
github.event.schedule should contain the cron expression currently defined in
the workflow file (*/10 * * * *), not the previously removed one (*/5 * * * *).
Runner Version and Platform
GitHub-hosted runner (ubuntu-latest). This is not a self-hosted runner issue.
What's not working?
The scheduled workflow fires with a cron expression that was removed from the workflow file. Any workflow logic that routes bxased on github.event.schedule (which is the documented way to distinguish between multiple schedules) breaks because the value doesn't match any current schedule definition.
Our real-world case:
We updated our scheduled from
on:
schedule:
- cron: '0 5 * * *'
- cron: '0 5 * * 6'to:
on:
schedule:
- cron: '0 5 * * 1-5' # updated
- cron: '0 5 * * 6'After merging to main, the scheduler still fires with 0 5 * * *, causing our
case statement (which routes config based on github.event.schedule) to fail:
Error: Unknown schedule: 0 5 * * *
Job Log Output
Failed run: https://github.com/ava-labs/firewood/actions/runs/21894045008/job/63206127030
From the debug logs, github.event.schedule evaluates to the old value:
##[debug]....Evaluating String:
##[debug]....=> 'schedule'
##[debug]..=> '0 5 * * *'
The workflow file being executed is the correct/current version (the case
statement contains the new cron branches), confirming the YAML on main is up to
date — only the scheduler's trigger payload is stale.
Details
-
Repository: ava-labs/firewood
-
Workflow:
.github/workflows/track-performance.yml— C-Chain Reexecution Performance Tracking -
Cron syntax in the workflow (current, on
main):schedule: - cron: '0 5 * * 1-5' - cron: '0 5 * * 6'
-
Stale cron received by runner:
0 5 * * *