Skip to content
Merged
34 changes: 26 additions & 8 deletions .github/workflows/discord_issues.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,44 @@
name: Discuss on Discord

on:
issues:
types:
- labeled
pull_request:
types:
- labeled
workflow_dispatch:
inputs:
issue_number:
description: 'Issue number'
required: true

pull_request_number:
description: 'Pull request number'

permissions:
issues: write
pull-requests: write

jobs:
discord:
runs-on: ubuntu-latest
steps:
- name: Discuss on Discord
- name: "Discuss on Discord-Issues"
if: github.event.issue && contains(github.event.issue.labels.*.name, 'help wanted')
uses: EndBug/[email protected]
if: ${{ github.event.label.name == 'help wanted' }}
with:
discord_bot_token: ${{ secrets.DISCORD_BOT_TOKEN }}
destination: ${{ secrets.DISCORD_BOT_DESTINATION }}
issue_number: ${{ github.event.inputs.issue_number || github.event.issue.number }}
issue_comment: Hey 👋, I've just created a [thread]($THREAD_LINK$) for this issue on [PyTorch-Ignite Discord](https://pytorch-ignite.ai/chat) where you can quickly talk to the community on the topic.
discord_bot_token: ${{ secrets.DISCORD_BOT_TOKEN }}
destination: ${{ secrets.DISCORD_BOT_DESTINATION }}
issue_number: ${{ github.event.inputs.issue_number || github.event.issue.number }}
issue_comment: Hey 👋, I've just created a [thread]($THREAD_LINK$) for this issue on [PyTorch-Ignite Discord](https://pytorch-ignite.ai/chat) where you can quickly talk to the community on the topic.
discord_message: New issue created in `${{ github.repository }}`:<https://github.com/${{ github.repository }}/issues/${{ github.event.issue.number }}>

- name: "Discuss on Discord-PR (Non-maintainer only)"
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'help wanted')
uses: EndBug/[email protected]
with:
discord_bot_token: ${{ secrets.DISCORD_BOT_TOKEN }}
destination: ${{ secrets.DISCORD_BOT_DESTINATION }}
issue_number: ${{ github.event.inputs.pull_request_number || github.event.pull_request.number }}
issue_comment: Hey 👋, I've just created a [thread]($THREAD_LINK$) for this pull request on [PyTorch-Ignite Discord](https://pytorch-ignite.ai/chat) where you can quickly talk to the community on the topic.
discord_message: New PR created in `${{ github.repository }}`:<https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}>