Replies: 36 comments 24 replies
-
|
Why isn't this implemented yet? gitlab is already having this functionality afaik |
Beta Was this translation helpful? Give feedback.
-
|
Any existing workaround? Also, I see that the workflow is sometimes not triggered at all even though I have my own runner which is in idle state. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the feedback @cj81499. I certainly agree that time zones and scheduling is tricky, so I'll make sure that this is on the backlog. |
Beta Was this translation helpful? Give feedback.
-
|
We are also interested in this feature. Are there any plans to implement a timezone support? |
Beta Was this translation helpful? Give feedback.
-
|
Just bringing up another use case that would benefit with the addition of this, in case it further helps convince the addition of this feature. For asian timezone regions, such as here in Singapore (GMT+8), a relatively simple use case of running a workflow on midnight of every 1st day of the month, is basically impossible to schedule as: 12AM here on the first day of the month would be have been basically impossible to write with cron, since, it would require writing it as 4PM of the last day of the month could be 28, 29, 30 or 31. For example: Having this would make it easy to schedule with just a |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
Another really useful feature would be to be able to add random jitter like cron supports because we can run into ratelimits when we have multiple actions running at the same time. |
Beta Was this translation helpful? Give feedback.
-
|
As a super hacky workaround, you can schedule your workflow to run at BOTH standard and daylight times, and then use a bash script to filter out the undesirable runs. This means you'll have 2 runs for every schedule date, but only one of them will execute past the Something like this should work: on:
schedule:
- cron: "00 18,19 * * TUE" # Run every tuesday at 12:00 noon MDT (GMT-6) and MST (GMT-7)
env:
TZ: "America/Edmonton"
LOCAL_TIME: "12:00"
jobs:
test-date:
runs-on: ubuntu-latest
steps:
- name: Test schedule
if: github.event_name == 'schedule'
run: |
now=$(date +%s)
local_time=$(date -d "$LOCAL_TIME" +%s)
if [[ $now -gt $local_time && $now -lt "$((local_time + 3600))" ]]; then
echo "🌞 Passed daylight savings time check!"
else
echo "⏱ Waiting until $LOCAL_TIME."
exit 1
fi |
Beta Was this translation helpful? Give feedback.
-
|
I've created a Workaround like @bcowdery, but mine won't fail the run: on:
schedule:
- cron: '5 16,17 * * *'
jobs:
check-run:
runs-on: ubuntu-latest
outputs:
run: ${{ steps.check_local_time.outputs.run }}
steps:
- name: Check local time
id: check_local_time
env:
TRIGGER: ${{ github.event_name }}
run: |
echo "Trigger: ${TRIGGER}"
if [[ ${TRIGGER} == 'schedule' ]]; then
echo "Checking daylight saving time"
if [ $(date --date='TZ="Europe/Berlin" now' +%H) -eq '18' ]; then
echo 'Time to run!'
echo "run=True" >> "$GITHUB_OUTPUT"
else
echo "It's not 18:05 local time in Europe/Berlin. Waiting for next execution..."
echo "run=False" >> "$GITHUB_OUTPUT"
fi
else
echo 'Trigger is not cron, ommiting time check!'
echo "run=True" >> "$GITHUB_OUTPUT"
fi
my-job:
runs-on: ubuntu-latest
if: needs.check-run.outputs.run == 'True'
needs: check-runStill, I would love to not use this workaround, but perhaps this is useful for anybody. |
Beta Was this translation helpful? Give feedback.
-
|
My team continue waiting for this feature, do you know if GitHub team already have a ticket in progress to attend it? @cj81499 @rahulmr Thanks! |
Beta Was this translation helpful? Give feedback.
-
|
This is a much needed feature in GH, any updates on this please. |
Beta Was this translation helpful? Give feedback.
-
|
any progress on this feature? thanks! |
Beta Was this translation helpful? Give feedback.
-
|
Hi guys any updates on this? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
Seems like easy to implement and would sove a lot of problem. |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
Please do not comment "waiting...", "+1", "need this", etc. It adds nothing to the conversation and spams our inboxes. Instead, leave a thumbs up or upvote to show your interest in this feature. If you'd like to follow along for any updates to this thread, you can subscribe to the discussion without commenting by clicking the "Subscribe" button on the sidebar. |
Beta Was this translation helpful? Give feedback.
-
|
Hi I’m surprised we are finishing 2024 and this is still not implemented after so much interest from the community Would you be open to allow the community to do a PR with the relevant changes, if this is not a priority for you? |
Beta Was this translation helpful? Give feedback.
-
|
Sorry no one has commented on this for a while, I will add this to our papercut backlog we are working though. I don't have a timeframe right now but I will check what the effort is. Thanks for your patience with this <3 |
Beta Was this translation helpful? Give feedback.
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
|
Reading the comments here, it is unclear to me whether or not the code responsible for accommodating timezone is public or not. If it is, can someone share which repo and code the community can work with to add this feature? |
Beta Was this translation helpful? Give feedback.
-
|
I need this feature. |
Beta Was this translation helpful? Give feedback.
-
|
Since GitHub Actions doesn’t support timezones in cron scheduling yet, here’s a possible workaround to run workflows at local times like 8 AM PST. name: Run Task at 8 AM
on:
schedule:
# Runs at 3 PM UTC (8 AM PDT) and 4 PM UTC (8 AM PST)
- cron: '0 15,16 * * *'
jobs:
check_time:
runs-on: ubuntu-latest
steps:
- name: Check if it's 8 AM
run: |
current_hour=$(TZ='America/Los_Angeles' date +'%H')
echo "Current hour in PST: $current_hour"
if [ "$current_hour" == "08" ]; then
echo "It's 8 AM PST! Running tasks..."
echo "run_tasks=true" >> $GITHUB_ENV
fi
- name: Execute Scheduled Tasks
if: env.run_tasks == 'true'
run: echo "Executing scheduled tasks..."
|
Beta Was this translation helpful? Give feedback.
-
|
For an approximate answer, I noted that the DST transition for |
Beta Was this translation helpful? Give feedback.
-
|
Setting the |
Beta Was this translation helpful? Give feedback.
-
|
Any updates on this? We need this feature in our project as well and now have to manually adjust schedule two times per year. We can manage with a workaround provided by @coltenkrauter (thanks by the way!) but it would be way better to just give the timezone and forget about it. |
Beta Was this translation helpful? Give feedback.
-
|
We are currently having a look at this to see what we can do :) hopefully this is something we can get moving very soon |
Beta Was this translation helpful? Give feedback.
-
|
We also would love to have this feature asap. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Originally brought up at actions/runner#1423, but I don't think anyone actually started a discussion.
Among other things, the use case I have in mind is to run a workflow at 10AM local time (the start of the workday), but the best I can do currently is 15:00 UTC (9:00 CST, 10:00 CDT) or 16:00 UTC (10:00 CST, 11:00 CDT), meaning that ~half the year, it'll run at an undesirable time.
Important
Please do not comment "waiting...", "+1", "need this", etc.
It adds nothing to the conversation and spams inboxes. Instead, leave a thumbs up and/or upvote to show your interest in this feature.
If you'd like to follow along for any updates to this thread, you can subscribe to the discussion by clicking the "Subscribe" button on the sidebar.
Beta Was this translation helpful? Give feedback.
All reactions