-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (37 loc) · 1.44 KB
/
notify-discord.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
34
35
36
37
38
39
40
41
42
43
44
on:
schedule:
- cron: '32 16 * * 4'
workflow_dispatch:
jobs:
parse-votes:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.7'
- name: Install requirements
run: pip install -r requirements.txt
- name: Parse votes
id: parse-votes
run: |
VOTES=$(framadatectl --url ${{ secrets.FRAMADATE_ADMIN_URL }} show next-slot)
MAP='${{ secrets.DISCORD_USERNAME_MAP }}'
USERS=$(./parse-votes.sh "$VOTES" "$MAP")
echo "users=${USERS}">> "$GITHUB_OUTPUT"
outputs:
users: ${{ steps.parse-votes.outputs.users }}
notify-discord:
runs-on: ubuntu-latest
needs: parse-votes
steps:
- name: Notify Discord channel
if: ${{ needs.parse-votes.outputs.users != ', ' }}
env:
DISCORD_USERNAME: Greater Good Gathering Guide
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
USERS: ${{ needs.parse-votes.outputs.users }}
run: |
curl --header "Content-Type: application/json" --data "{\"username\": \"${DISCORD_USERNAME}\", \"content\": \"${USERS}you are signed up for Saturday! Would anyone else want to join? Unless someone writes something else, meeting point is at 12:00 at acend. May the dice gods be with you! :game_die:\"}" ${DISCORD_WEBHOOK_URL}