File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 7
7
8
8
jobs :
9
9
determine-date :
10
- name : Release buildpacks on 2nd and 4th Thursday of the month
10
+ name : Release buildpacks on 2nd and last Thursdays of the month
11
11
runs-on : ubuntu-22.04
12
12
outputs :
13
13
should_run : ${{ steps.should_run.outputs.bool }}
@@ -20,14 +20,16 @@ jobs:
20
20
echo "bool=true" >> "${GITHUB_OUTPUT}"
21
21
else
22
22
day_of_month=$(date +%d)
23
- # Check if it's the second or fourth Thursday of the month
23
+ last_day_cutoff=$(expr $(date -d "-$(date +%d) days month" +%d) - 6)
24
+ # Check if it's the second or last Thursday of the month
24
25
# second thursday of the month will always be between day 8 and 14 (inclusive)
25
26
if [[ "$day_of_month" -ge "8" && "$day_of_month" -le "14" ]]; then
26
27
echo "It's the second Thursday of the month"
27
28
echo "bool=true" >> "${GITHUB_OUTPUT}"
28
- # fourth thursday of the month will always be between day 21 and 28 (inclusive)
29
- elif [[ "$day_of_month" -ge "22" && "$day_of_month" -le "28" ]]; then
30
- echo "It's the fourth Thursday of the month"
29
+ # last thursday of the month will always be within 6 days of the last day of the month
30
+ # $last_day_cutoff=(# days in this month - 6)
31
+ elif [[ "$day_of_month" -ge "$last_day_cutoff" ]]; then
32
+ echo "It's the last Thursday of the month"
31
33
echo "bool=true" >> "${GITHUB_OUTPUT}"
32
34
else
33
35
echo "It's another Thursday of the month"
You can’t perform that action at this time.
0 commit comments