Skip to content

Commit 3464616

Browse files
feat: reschedule releases (CORE-2065) (#96)
* feat: 🎸 release on next day except Fridays and weekends βœ… Closes: CORE-2065 * chore: πŸ€– remove files βœ… Closes: CORE-2065 * feat: 🎸 reschedule for 2 days into the future βœ… Closes: CORE-2065
1 parent caad3c6 commit 3464616

1 file changed

Lines changed: 18 additions & 7 deletions

File tree

β€Ž.github/actions/tag-jira-release/jira_create_release.shβ€Ž

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,25 @@ fi
3636
function next_release_date() {
3737
target_day=$1
3838

39-
# Get the current day of the week (0-6)
40-
current_day=$($DATE_PATH +%u)
41-
42-
# Calculate days until next target day
43-
if [ "$current_day" -ge "$target_day" ]; then
44-
days_until_target_day=$(( 7 + ($target_day + 7 - $current_day) % 7 ))
39+
# Calculate days until the next valid release day
40+
if [ "$current_day" -eq 3 ]; then
41+
# If today is Wednesday (3), skip Friday and schedule for Monday (5 days later)
42+
days_until_target_day=$(( 5 ))
43+
elif [ "$current_day" -eq 4 ]; then
44+
# If today is Thursday (4), schedule for Monday (4 days later)
45+
days_until_target_day=$(( 4 ))
46+
elif [ "$current_day" -eq 5 ]; then
47+
# If today is Friday (5), schedule for Tuesday (4 days later)
48+
days_until_target_day=$(( 4 ))
49+
elif [ "$current_day" -eq 6 ]; then
50+
# If today is Saturday (6), schedule for Tuesday (3 days later)
51+
days_until_target_day=$(( 3 ))
52+
elif [ "$current_day" -eq 0 ]; then
53+
# If today is Sunday (0), schedule for Tuesday (2 days later)
54+
days_until_target_day=$(( 2 ))
4555
else
46-
days_until_target_day=$(( ($target_day - $current_day) % 7 ))
56+
# For Monday (1), Tuesday (2), schedule two days ahead
57+
days_until_target_day=$(( 2 ))
4758
fi
4859

4960
# Get the date of next target day in YYYY-MM-DD format

0 commit comments

Comments
Β (0)