GH-200 · Question #52
Scheduled workflows run on the:
Scheduled workflows in GitHub Actions always execute against the latest commit on the repository's default branch, not a pinned commit or a named schedule branch.
Question
Scheduled workflows run on the:
Options
- Aspecified commit and branch from the workflow YAML file.
- Blatest commit from the branch named schedule.
- Clatest commit and branch on which the workflow was triggered.
- Dlatest commit from the branch named main.
- Elatest commit on the default or base branch.
Why each option
Scheduled workflows in GitHub Actions always execute against the latest commit on the repository's default branch, not a pinned commit or a named schedule branch.
Workflow YAML files do not embed a specific commit SHA for schedule events; the schedule trigger resolves to the live default branch tip at runtime, not a statically referenced commit.
GitHub does not recognize or require a branch named 'schedule'; no such reserved branch name exists in the Actions scheduling mechanism.
The concept of a 'branch on which the workflow was triggered' applies to push or pull_request events, not schedule events, because schedule is a time-based trigger with no associated branch push.
While 'main' is a common default branch name, the correct behavior targets the repository's configured default branch regardless of its name, which may be master, develop, or any other value.
Concept tested: GitHub Actions schedule trigger default branch behavior
Source: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule
Topics
Community Discussion
No community discussion yet for this question.