Skip to content

Commit a46903e

Browse files
Discord Workflow for Issues and pull-requests(non-maintainers-only) (#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>
1 parent c8d6a58 commit a46903e

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed
Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,44 @@
11
name: Discuss on Discord
2+
23
on:
34
issues:
45
types:
56
- labeled
7+
pull_request:
8+
types:
9+
- labeled
610
workflow_dispatch:
711
inputs:
812
issue_number:
913
description: 'Issue number'
10-
required: true
11-
14+
pull_request_number:
15+
description: 'Pull request number'
16+
1217
permissions:
1318
issues: write
19+
pull-requests: write
1420

1521
jobs:
1622
discord:
1723
runs-on: ubuntu-latest
1824
steps:
19-
- name: Discuss on Discord
25+
- name: "Discuss on Discord-Issues"
26+
if: github.event.issue && contains(github.event.issue.labels.*.name, 'help wanted')
2027
uses: EndBug/discuss-on-discord@v1.1.0
21-
if: ${{ github.event.label.name == 'help wanted' }}
2228
with:
23-
discord_bot_token: ${{ secrets.DISCORD_BOT_TOKEN }}
24-
destination: ${{ secrets.DISCORD_BOT_DESTINATION }}
25-
issue_number: ${{ github.event.inputs.issue_number || github.event.issue.number }}
26-
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.
29+
discord_bot_token: ${{ secrets.DISCORD_BOT_TOKEN }}
30+
destination: ${{ secrets.DISCORD_BOT_DESTINATION }}
31+
issue_number: ${{ github.event.inputs.issue_number || github.event.issue.number }}
32+
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.
33+
discord_message: New issue created in `${{ github.repository }}`:<https://github.com/${{ github.repository }}/issues/${{ github.event.issue.number }}>
34+
35+
- name: "Discuss on Discord-PR (Non-maintainer only)"
36+
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'help wanted')
37+
uses: EndBug/discuss-on-discord@v1.1.0
38+
with:
39+
discord_bot_token: ${{ secrets.DISCORD_BOT_TOKEN }}
40+
destination: ${{ secrets.DISCORD_BOT_DESTINATION }}
41+
issue_number: ${{ github.event.inputs.pull_request_number || github.event.pull_request.number }}
42+
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.
43+
discord_message: New PR created in `${{ github.repository }}`:<https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}>
44+

0 commit comments

Comments
 (0)