@@ -2,7 +2,7 @@ name: Create OCWM Monthly
22
33on :
44 schedule :
5- - cron : " 0 9 * * 2 " # Runs at 9 :00 AM every Tuesday
5+ - cron : " 0 23 * * 1 " # Runs at 11 :00 PM every Monday
66
77 repository_dispatch :
88 types : ocwm-creator
@@ -47,30 +47,28 @@ jobs:
4747
4848 # Step to check if it's the third Tuesday of the month
4949 - name : Check if today is the third Tuesday
50- id : check-third-tuesday
50+ id : check-third-monday
5151 run : |
5252 day=$(date +%d)
5353 dow=$(date +%u) # Day of the week (1 = Monday, ..., 7 = Sunday)
54- # Get the first day of this month
55- first_tuesday=$(cal | awk '/^..$/ {print $3}')
56- if [ "$dow" -ne 2 ]; then
57- echo "Not a Tuesday, exiting..."
58- echo "::set-output name=is-third-tuesday::false"
54+ # Check if the day is between 15th and 21st, and if it's Monday (1)
55+ if [ "$dow" -ne 1 ]; then
56+ echo "Not a Monday, exiting..."
57+ echo "::set-output name=is-third-monday::false"
5958 exit 0
6059 fi
61- # Calculate the third Tuesday by checking if the current date is between 15th and 21st
6260 if [ "$day" -ge 15 ] && [ "$day" -le 21 ]; then
63- echo "This is the third Tuesday of the month!"
64- echo "::set-output name=is-third-tuesday ::true"
61+ echo "This is the third Monday of the month!"
62+ echo "::set-output name=is-third-monday ::true"
6563 else
66- echo "Not the third Tuesday , exiting..."
67- echo "::set-output name=is-third-tuesday ::false"
64+ echo "Not the third Monday , exiting..."
65+ echo "::set-output name=is-third-monday ::false"
6866 exit 0
6967 fi
7068
7169 - name : Create Issue using Template
7270 id : create-issue
73- if : steps.check-third-tuesday.outputs.is-third-tuesday == 'true'
71+ if : steps.check-third-tuesday.outputs.is-third-monday == 'true'
7472 uses : peter-evans/create-issue-from-file@v5
7573 with :
7674 title : ${{ steps.create-title.outputs.title }}
0 commit comments