-
Notifications
You must be signed in to change notification settings - Fork 10
33 lines (29 loc) · 995 Bytes
/
meet-issue.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Monthly Meeting Reminder
on:
schedule:
- cron: '0 0 23 * *' # Run on the 23rd of every month at 00:00 UTC
workflow_dispatch:
jobs:
create-issue:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get next meeting date
id: next-meeting
run: |
next_month=$(date -d 'next month' +'%Y-%m-01')
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@v5
with:
title: Meeting [${{ steps.next-meeting.outputs.date }}]
content-filepath: ./Meeting.md
labels: meeting