Skip to content

Post - Announcement GHD topics #218

Post - Announcement GHD topics

Post - Announcement GHD topics #218

name: Post - Announcement GHD topics
on:
discussion:
types:
- created
jobs:
run:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'sofa-framework' }}
steps:
- name: Check out code
uses: actions/checkout@v2
if: ( github.event.discussion.category.name == 'Announcement' ) || ( github.event.discussion.category.name == 'Share your achievements' )
- name: Set up python
uses: actions/setup-python@v5
if: ( github.event.discussion.category.name == 'Announcement' ) || ( github.event.discussion.category.name == 'Share your achievements' )
with:
python-version: '3.12'
- name: Install pip packages
if: ( github.event.discussion.category.name == 'Announcement' ) || ( github.event.discussion.category.name == 'Share your achievements' )
run: |
pip install python-graphql-client
pip install python-dateutil
pip install requests
working-directory: ${{ github.workspace }}
- name: Run script post-discord-message.py
if: ( github.event.discussion.category.name == 'Announcement' ) || ( github.event.discussion.category.name == 'Share your achievements' )
run: |
python scripts/discord/post-discord-message.py
working-directory: ${{ github.workspace }}
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_ANNOUNCEMENTS_WEBHOOK_URL }}
MESSAGE: ":loudspeaker: New post \"${{github.event.discussion.category.name}}\" :arrow_right: **[${{github.event.discussion.title}}](https://github.com/sofa-framework/sofa/discussions/${{github.event.discussion.number}})** by [${{github.event.discussion.user.login}}](https://github.com/${{github.event.discussion.user.login}})"
BOT_NAME: "Discussion announcement"
EMBEDS_TITLE: "${{github.event.discussion.title}}"
EMBEDS_URL: "https://github.com/sofa-framework/sofa/discussions/${{github.event.discussion.number}}"
EMBEDS_DESCRIPTION: ""