Skip to content

Commit

Permalink
Discord Workflow for Issues and pull-requests(non-maintainers-only) (#…
Browse files Browse the repository at this point in the history
…3009)

* Added discuss_on_discord extension

* Added workflow to create threads for help wanted issues on discord

* Update .github/workflows/discord_issues.yml

Co-authored-by: vfdev <vfdev.5@gmail.com>

* Added check for non-maintainer based PRs to discuss in discord

* Changed the set-output type pattern

* Update .github/workflows/discord_issues.yml

Co-authored-by: vfdev <vfdev.5@gmail.com>

* Adding right destination for discord channel

* Update Non-maintainers requirement in discord_issues.yml

---------

Co-authored-by: vfdev <vfdev.5@gmail.com>
  • Loading branch information
guptaaryan16 and vfdev-5 committed Jul 29, 2023
1 parent c8d6a58 commit a46903e
Showing 1 changed file with 26 additions and 8 deletions.
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/discuss-on-discord@v1.1.0
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/discuss-on-discord@v1.1.0
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 }}>

0 comments on commit a46903e

Please sign in to comment.