From 5a36f9748f3bf77306602b7a23e78e9d8457411d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rnar=20Snoksrud?= Date: Sat, 12 Sep 2026 03:52:29 +0200 Subject: [PATCH] discord: notify this repo about its own issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This repo supplies every other repo's Discord notifications and had none for its own issues. An issue filed here reached nobody, which is how novem-code/github-actions#9 was filed into silence. Adds an `issues` trigger and an inline job using this repo's own discord-notify action. Inline rather than a fourth reusable workflow: a reusable workflow here is an interface other repos pin, and adding one is a bigger decision than this repo notifying itself. gaia keeps its own issue notifier inline for the same reason. Also gates notify_pr on `github.event_name == 'pull_request'`, which it did not need while only pull_request and push fired this file. On a push `github.event.action` is empty, so the composer's else branch drops the message and the stray job is invisible. An issue is not like that — its action is literally `opened`, which the composer's first branch matches, so without the gate every issue would post a PR notification carrying an empty title and number. --- .github/workflows/discord.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.github/workflows/discord.yml b/.github/workflows/discord.yml index 6b2fa04..934803a 100644 --- a/.github/workflows/discord.yml +++ b/.github/workflows/discord.yml @@ -11,9 +11,23 @@ on: push: branches: - main + # This repo supplies every other repo's notifications and had none for its + # own issues, so one filed here reached nobody. + issues: + types: + - opened + - closed + - reopened jobs: + # Gated on the event, which it did not need to be while only pull_request + # and push fired this file: on a push `github.event.action` is empty and the + # composer's else branch drops the message. An issue is different — its + # action is literally `opened`, which the composer's first branch matches, so + # without this an issue would post a PR notification with an empty title and + # number. notify_pr: + if: github.event_name == 'pull_request' uses: ./.github/workflows/discord_pr.yml with: pr_title: ${{ github.event.pull_request.title }} @@ -34,6 +48,27 @@ jobs: secrets: discord_webhook: ${{ secrets.DISCORD_WEBHOOK_URL }} + # Inline rather than a fourth reusable workflow: a reusable workflow here is + # an interface other repos pin, and adding one is a bigger decision than + # this repo notifying itself. gaia keeps its own issue notifier inline for + # the same reason. + notify_issue: + if: github.event_name == 'issues' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Notify Discord of the issue + uses: ./discord-notify + with: + webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }} + content: >- + ${{ github.event.action == 'opened' && 'â„šī¸' || + github.event.action == 'reopened' && '🔁' || '✅' }} + ${{ github.event.repository.name }} > + [#${{ github.event.issue.number }}: ${{ github.event.issue.title }}](<${{ github.event.issue.html_url }}>) + ${{ github.event.action == 'opened' && 'was opened.' || + github.event.action == 'reopened' && 'was reopened.' || 'was closed.' }} + dummy: runs-on: ubuntu-latest steps: