Add support for timezone for schedule triggers#641
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for GitHub Actions’ new on.schedule[].timezone key by extending the schedule event AST/parsing and validating timezone values during linting.
Changes:
- Extend the schedule AST from a list of cron strings to a list of schedule entries (
cron+ optionaltimezone). - Update parsing and rule checks to accept/validate
timezonefor scheduled workflows. - Add new ok/err testdata coverage for timezone usage and invalid timezone values.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| testdata/ok/schedule_timezone.yaml | Adds a valid workflow example using schedule[].timezone. |
| testdata/err/schedule_invalid_timezone.yaml | Adds an invalid timezone example to ensure linting fails. |
| testdata/err/schedule_invalid_timezone.out | Expected linter output for invalid timezone validation. |
| rule_expression.go | Updates expression scanning to traverse the new schedule entry structure. |
| rule_events.go | Validates timezone strings (via time.LoadLocation) for schedule entries. |
| parse.go | Parses schedule list elements as mappings with cron and optional timezone. |
| ast.go | Introduces ScheduleEntry and changes ScheduledEvent to store entries (breaking API). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@rhysd can you please review this. We would love to adopt this change since Day light saving is going to start soon and we would like to avoid adjusting our cron hours since lint checks are failing. Thanks |
|
I'm sorry for the delay. I could not take enough time to review this. |
rhysd
left a comment
There was a problem hiding this comment.
Implementation looks good and this branch even has additional checks for the timezone string. I'll merge this branch.
Adds timezone support for scheduled workflows - documentation.
Closes #638.
Closes #639.