Skip to content

Commit 8b2f265

Browse files
authored
Refactor issue label workflow for Discord notifications (#3950)
1 parent e202239 commit 8b2f265

1 file changed

Lines changed: 10 additions & 28 deletions

File tree

.github/workflows/issue-label.yml

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,15 @@
1-
name: Issue labels
1+
name: Issues notify
22

33
on:
44
issues:
5-
types: [labeled, reopened, closed, deleted]
6-
7-
env:
8-
DISCORD_WEBHOOK: ${{ secrets.DISCORD_ISSUES_WEBHOOK }}
5+
types:
6+
- opened
7+
- labeled
8+
- unlabeled
9+
- closed
910

1011
jobs:
11-
labelNotify:
12-
runs-on: ubuntu-latest
13-
timeout-minutes: 5
14-
steps:
15-
- name: notify on label
16-
if: >
17-
github.event.label.name == 'enhancement'
18-
|| github.event.label.name == 'bug'
19-
|| github.event.label.name == 'help wanted'
20-
|| github.event.label.name == 'priority/high'
21-
|| github.event.label.name == 'question'
22-
|| github.event.label.name == 'status/waiting on upstream'
23-
uses: Ilshidur/action-discord@master
24-
with:
25-
args: "[${{ github.event.issue.title }} (#${{ github.event.issue.number }})](<${{ github.event.issue.html_url }}>) added `${{ github.event.label.name }}` label"
26-
- name: notify on action change
27-
if: >
28-
github.event.action == 'closed'
29-
|| github.event.action == 'reopened'
30-
|| github.event.action == 'deleted'
31-
uses: Ilshidur/action-discord@master
32-
with:
33-
args: "[${{ github.event.issue.title }} (#${{ github.event.issue.number }})](<${{ github.event.issue.html_url }}>) has been `${{ github.event.action }}` by `${{ github.event.sender.login }}`"
12+
notify:
13+
uses: itzg/github-workflows/.github/workflows/issues-notify-discord.yml@main
14+
secrets:
15+
discordWebhook: "${{secrets.DISCORD_ISSUES_WEBHOOK}}"

0 commit comments

Comments
 (0)