Skip to content

Commit 2a23299

Browse files
authored
[Improvement]: GHES scheduled-workflow docs show unsupported timezone syntax #23702 (#62591)
1 parent 8370380 commit 2a23299

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Scheduled workflows support timezones
2+
3+
versions:
4+
fpt: '*'
5+
ghec: '*'
6+
ghes: '>=3.22'

data/reusables/repositories/actions-scheduled-workflow-example.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
Use [POSIX cron syntax](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07) to schedule workflows to run at specific times. By default, scheduled workflows run in UTC. You can optionally specify a timezone using an [IANA timezone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for timezone-aware scheduling. Scheduled workflows run on the latest commit on the default branch. The shortest interval you can run scheduled workflows is once every 5 minutes.
1+
Use [POSIX cron syntax](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07) to schedule workflows to run at specific times. {% ifversion actions-schedule-timezone %}By default, scheduled workflows run in UTC. You can optionally specify a timezone using an [IANA timezone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for timezone-aware scheduling{% else %}Scheduled workflows run in UTC{% endif %}. Scheduled workflows run on the latest commit on the default branch. The shortest interval you can run scheduled workflows is once every 5 minutes.
2+
3+
{% ifversion actions-schedule-timezone %}
24

35
> [!NOTE]
46
> For schedules that set `timezone` to a time zone that observes daylight saving time (DST), during DST spring-forward transitions, scheduled workflows in skipped hours advance to the next valid time. For example, a 2:30 AM schedule advances to 3:00 AM.
57
8+
{% endif %}
9+
610
{% data reusables.repositories.cron %}
711

812
You can use these operators in any of the five fields:
@@ -14,6 +18,8 @@ You can use these operators in any of the five fields:
1418
| - | Range of values | `30 4-6 * * *` runs at minute 30 of the 4th, 5th, and 6th hour. |
1519
| / | Step values | `20/15 * * * *` runs every 15 minutes starting from minute 20 through 59 (minutes 20, 35, and 50). |
1620

21+
{% ifversion actions-schedule-timezone %}
22+
1723
This example triggers the workflow to run at 5:30 AM in the America/New_York timezone every Monday through Friday:
1824

1925
```yaml
@@ -23,6 +29,8 @@ on:
2329
timezone: "America/New_York"
2430
```
2531
32+
{% endif %}
33+
2634
A single workflow can be triggered by multiple `schedule` events. Access the `schedule` event that triggered the workflow through the `github.event.schedule` context. This example triggers the workflow to run at 5:30 UTC every Monday-Thursday, and 17:30 UTC on Tuesdays and Thursdays, but skips the `Not on Monday or Wednesday` step on Monday and Wednesday.
2735

2836
```yaml

0 commit comments

Comments
 (0)