-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from netz39/feat/meeting-reminder
Feat/meeting reminder
- Loading branch information
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Send out reminder about monthly meeting | ||
|
||
on: | ||
schedule: | ||
- cron: '1 0 * * SUN' | ||
workflow_dispatch: | ||
|
||
|
||
jobs: | ||
date: | ||
name: "Calculate Date" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- id: date | ||
run: | | ||
next_date=$(date -d "next Wednesday" "+%d.%m.") | ||
next_date_iso=$(date -d "next Wednesday" "+%Y-%m-%d") | ||
next_date_year=$(date -d "next Wednesday" "+%Y") | ||
echo "next_date=$next_date" >> "$GITHUB_OUTPUT" | ||
echo "next_date_iso=$next_date_iso" >> "$GITHUB_OUTPUT" | ||
echo "next_date_year=$next_date_year" >> "$GITHUB_OUTPUT" | ||
next_date_week=$(date -d "next Wednesday" "+%U") | ||
if [[ $(($next_date_week % 3)) != 0 ]]; | ||
then | ||
echo "::notice::Wrong week, skip sending reminder." | ||
exit 1 | ||
fi | ||
outputs: | ||
next_date: ${{ steps.date.outputs.next_date }} | ||
next_date_iso: ${{ steps.date.outputs.next_date_iso }} | ||
next_date_year: ${{ steps.date.outputs.next_date_year }} | ||
|
||
discord: | ||
name: "Discord" | ||
runs-on: ubuntu-latest | ||
needs: | ||
- date | ||
steps: | ||
- uses: cstuder/[email protected] | ||
with: | ||
title: "Netz39-Stammtisch am kommenden Mittwoch (${{ needs.date.outputs.next_date }}) um 19:30 Uhr!" | ||
message: "Folgende Themen werden besprochen: https://wiki.netz39.de/stammtisch:${{ needs.date.outputs.next_date_year }}:${{ needs.date.outputs.next_date_iso }}" | ||
env: | ||
APPRISE_URL: discord://${{ secrets.APPRISE_DISCORD_WEBHOOK_ID }}/${{ secrets.APPRISE_DISCORD_TOKEN }} | ||
|
||
email: | ||
name: "E-Mail" | ||
runs-on: ubuntu-latest | ||
needs: | ||
- date | ||
steps: | ||
- uses: cstuder/[email protected] | ||
with: | ||
title: "Netz39-Stammtisch am kommenden Mittwoch (${{ needs.date.outputs.next_date }})" | ||
message: |- | ||
Hallo Leute, | ||
am kommenden Mittwoch (${{ needs.date.outputs.next_date }}) findet um 19:30 unser nächster Netz39-Stammtisch in unseren Vereinsräumlichkeiten (Leibnizstraße 32) statt! Folgende Themen werden besprochen: https://wiki.netz39.de/stammtisch:${{ needs.date.outputs.next_date_year }}:${{ needs.date.outputs.next_date_iso }} | ||
Falls ihr hybrid teilnehmen möchtet, gebt uns bitte bis 2h vorher Bescheid, indem du auf diese Mail antwortetst. Dann kümmern wir uns um die Online-Variante. | ||
Viele Grüße, | ||
das Netz39-Team | ||
env: | ||
APPRISE_URL: mailtos://mail.netz39.de/?user=${{ secrets.APPRISE_MAIL_USER }}&pass=${{ secrets.APPRISE_MAIL_PASS }}&from=Netz39<[email protected]>&[email protected],[email protected] |