Skip to content

Commit 44c29d5

Browse files
committed
🐛 Fixes issue notification logic
Updates the issue notification workflow to: - Correctly check if the "Skip Discord" option is unchecked in the issue body. - Improves the reliability of the notification trigger. - Streamlines the issue description sent to Discord.
1 parent c27e7df commit 44c29d5

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

.github/workflows/issue-bug-to-discord.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ jobs:
88
notify_discord:
99
runs-on: ubuntu-latest
1010

11-
# Only run for bug issues and when the form didn't opt out of Discord
12-
if: >
13-
${{
14-
contains(github.event.issue.body, 'issue-type=bug') &&
15-
!contains(github.event.issue.body, 'Skip Discord')
16-
}}
11+
# Run only for Bug issues AND when Skip notify Discord is NOT checked
12+
if: ${{
13+
contains(github.event.issue.body, 'issue-type=bug') &&
14+
!contains(github.event.issue.body, '- [x] Skip notify Discord')
15+
}}
1716

1817
steps:
1918
- name: Send Discord notification
@@ -26,11 +25,9 @@ jobs:
2625
ISSUE_USER: ${{ github.event.issue.user.login }}
2726
REPO_NAME: ${{ github.repository }}
2827
run: |
29-
# Trim body to avoid huge messages
3028
SHORT_BODY=$(printf '%s' "$ISSUE_BODY" | head -c 400)
3129
[ -z "$SHORT_BODY" ] && SHORT_BODY="(no description)"
3230
33-
# Build JSON payload for Discord
3431
payload=$(jq -n \
3532
--arg username "GitHub Bot" \
3633
--arg content "" \

0 commit comments

Comments
 (0)