How to Schedule a Run at a Specific Timezone in GitHub Actions
GitHub cron has no timezone field, so convert your target local time to UTC and, if DST matters, verify inside the job.
Compute the UTC equivalent of your desired local time and put that in cron. Because UTC does not observe daylight saving, add a guard step that skips when the local hour is wrong.
Steps
- Convert the target local time to UTC and use that in
cron. - Add a schedule entry for each offset if you must cover DST changes.
- Guard with a step that checks the local hour via
TZand exits early if it does not match.
Workflow
.github/workflows/ci.yml
on:
schedule:
- cron: '0 13 * * *' # 09:00 America/New_York during EDT
jobs:
daily:
runs-on: ubuntu-latest
steps:
- name: Skip if not 09:00 local
run: |
HOUR=$(TZ=America/New_York date +%H)
[ "$HOUR" = "09" ] || { echo "Off-hour, skipping"; exit 0; }
- run: ./daily-task.shGotchas
- A fixed UTC cron drifts by one hour across daylight saving transitions.
- The
TZguard requires the tzdata package, which the ubuntu runners already include.
Related guides
How to Run a Workflow on a Cron Schedule in GitHub ActionsTrigger a GitHub Actions workflow on a recurring timetable with on.schedule and a five-field POSIX cron expre…
How to Skip a Scheduled Run Conditionally in GitHub ActionsSkip a GitHub Actions cron run when a condition holds, such as a holiday or an unchanged repository, using an…