Post - Announcement GHD topics #108
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
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 | |
- name: Install dependencies | |
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: "" | |