Skip to content

Add support for timezone for schedule triggers#641

Merged
rhysd merged 1 commit intorhysd:mainfrom
martincostello:gh-638
Mar 30, 2026
Merged

Add support for timezone for schedule triggers#641
rhysd merged 1 commit intorhysd:mainfrom
martincostello:gh-638

Conversation

@martincostello
Copy link
Copy Markdown
Contributor

@martincostello martincostello commented Mar 20, 2026

@martincostello martincostello marked this pull request as ready for review March 20, 2026 11:58
Copilot AI review requested due to automatic review settings March 20, 2026 11:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 + optional timezone).
  • Update parsing and rule checks to accept/validate timezone for 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.

@saad352
Copy link
Copy Markdown

saad352 commented Mar 26, 2026

@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

@rhysd
Copy link
Copy Markdown
Owner

rhysd commented Mar 30, 2026

I'm sorry for the delay. I could not take enough time to review this.

Copy link
Copy Markdown
Owner

@rhysd rhysd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation looks good and this branch even has additional checks for the timezone string. I'll merge this branch.

@rhysd rhysd merged commit 4897c1d into rhysd:main Mar 30, 2026
21 of 22 checks passed
@martincostello martincostello deleted the gh-638 branch March 30, 2026 16:25
rhysd added a commit that referenced this pull request Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for timezone for schedule triggers

4 participants