Skip to content

Commit

Permalink
Merge pull request #7 from netz39/feat/meeting-reminder
Browse files Browse the repository at this point in the history
Feat/meeting reminder
  • Loading branch information
24367dfa authored Jun 17, 2023
2 parents 86910ba + 15185e4 commit 1bb8ad2
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/meeting-reminder.yaml
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]

0 comments on commit 1bb8ad2

Please sign in to comment.