Skip to content

Post - SOFA dev meeting agenda/reminder #189

Post - SOFA dev meeting agenda/reminder

Post - SOFA dev meeting agenda/reminder #189

name: Post - SOFA dev meeting agenda/reminder
on:
schedule:
- cron: '30 8 * * 1' # 9:30 am UTC+1 every Monday
- cron: '00 7 * * 4' # 8:00 am UTC+1 on Thursdays -> targeting 9:00 am CET
- cron: '00 6 * * 4' # 7:00 am UTC+1 on Thursdays (for summer times) -> targeting 9:00 am CET
env:
TZ: "Europe/Paris"
jobs:
run:
runs-on: ubuntu-slim
if: ${{ github.repository_owner == 'sofa-framework' }}
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install pip packages
run: |
pip install python-graphql-client
pip install python-dateutil
pip install requests
working-directory: ${{ github.workspace }}
# Monday message : request agenda info
- name: Run script post-discord-message.py
if: github.event.schedule == '30 8 * * 1'
run: |
python Discord/post-discord-message.py
working-directory: ${{ github.workspace }}
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_MAIN_WEBHOOK_URL }}
MESSAGE : ":sunrise: Morning, dear SOFA community! Next Thursday takes place the weekly SOFA dev meeting:\n**_Any specific topic to share or to discuss?_** If so, please reply in this thread :speech_balloon: *Remember you can use the tag \"pr: dev meeting topic\" for your PRs*"
BOT_NAME: "Meeting reminder"
EMBEDS_TITLE: "Label \"pr: dev-meeting topic\""
EMBEDS_URL: "https://github.com/sofa-framework/sofa/labels/pr%3A%20dev%20meeting%20topic"
EMBEDS_DESCRIPTION: ""
# Thursday message : announce meeting and share link
- name: Check time depending on winter/summer times
if: ${{ (github.event.schedule == '00 7 * * 4') || (github.event.schedule == '00 6 * * 4') }}
id: check_time
run: |
# Set the timezone to CET
sudo ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime
sudo dpkg-reconfigure -f noninteractive tzdata
# Get the current hour in CET
current_hour=$(date +'%H')
# Check if the current hour is 9 and set output
if [ "$current_hour" -eq 9 ]; then
echo "::set-output name=itstime::true"
else
echo "::set-output name=itstime::false"
fi
- name: Run script post-discord-message.py
if: steps.check_time.outputs.itstime == 'true'
run: |
python Discord/post-discord-message.py
working-directory: ${{ github.workspace }}
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_MAIN_WEBHOOK_URL }}
MESSAGE: "SOFA dev meeting is about to get started :tv: See you online!"
BOT_NAME: "Meeting reminder"
EMBEDS_TITLE: "SOFA dev visio link"
EMBEDS_URL: "https://www.sofa-framework.org/sofa-dev-meeting"
EMBEDS_DESCRIPTION: ""