Skip to content

Cron scheduled returns stale cron expression after updating workflow schedule triggers #4241

@Elvis339

Description

@Elvis339

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

  1. Create a workflow on the default branch with a schedule trigger:

    on:
      schedule:
        - cron: '*/5 * * * *'  # every five minute
  2. Merge it. Confirm scheduled runs fire with github.event.schedule = */5 * * * *.

  3. Update the cron expression and push to the default branch:

    on:
      schedule:
        - cron: '*/10 * * * *'  # every 10 minutes
  4. Wait for the next scheduled trigger.

  5. Observe that github.event.schedule still 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.ymlC-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 * * *

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions