Skip to content

Commit

Permalink
Use bash for next meet date
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijrajsharma authored Apr 30, 2024
1 parent 1393e89 commit 770ed9d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/meet-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@ jobs:
id: next-meeting
run: |
next_month=$(date -d 'next month' +'%Y-%m-01')
day=$(date -d "$next_month +$(date -d "$next_month" +'%u' | awk '{print 3-$1%7"%7"}') day" +'%Y-%m-%d')
echo "::set-output name=date::$day"
day=$(date -d "$next_month" +'%Y-%m-%d')
day_of_week=$(date -d "$day" +'%u') # 1 = Monday, 7 = Sunday
if [ "$day_of_week" -eq 3 ]; then
echo "::set-output name=date::$day"
else
days_to_add=$(( 3 - day_of_week + 7 ))
echo "::set-output name=date::$(date -d "$day +$days_to_add days" +'%Y-%m-%d')"
fi
- name: Create monthly meeting issue
uses: peter-evans/create-issue-from-file@v4
with:
Expand Down

0 comments on commit 770ed9d

Please sign in to comment.