From f4f9f7cc21a3c93622f8324cc0321885a2b76218 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Mon, 11 May 2026 23:10:10 -0400 Subject: [PATCH] ci: add moonlight discord rss-notifications --- .github/workflows/rss-notifier.yml | 55 ++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/.github/workflows/rss-notifier.yml b/.github/workflows/rss-notifier.yml index bf6192a..9a78103 100644 --- a/.github/workflows/rss-notifier.yml +++ b/.github/workflows/rss-notifier.yml @@ -49,6 +49,33 @@ jobs: return 'true'; + moonlight-conditions: + if: needs.authorize.outputs.authorized == 'true' + needs: authorize + outputs: + post: ${{ steps.conditions.outputs.result }} + runs-on: ubuntu-latest + steps: + - name: Check Moonlight Discord conditions + id: conditions + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + with: + result-encoding: string + script: | + const title = context.payload.issue.title; + const conditions = [ + { + name: 'Sunshine release', + matches: /^Sunshine v[0-9]+(?:\.[0-9]+)* Released$/.test(title) + } + ]; + + for (const condition of conditions) { + console.log(`${condition.name}: ${condition.matches}`); + } + + return conditions.some(condition => condition.matches) ? 'true' : 'false'; + discord: if: needs.authorize.outputs.authorized == 'true' needs: authorize @@ -68,6 +95,25 @@ jobs: username: ${{ vars.DISCORD_USERNAME }} webhook: ${{ secrets.DISCORD_ANNOUNCEMENT_WEBHOOK }} + discord-moonlight: + if: needs.moonlight-conditions.outputs.post == 'true' + needs: moonlight-conditions + outputs: + post-url: "https://discord.com/channels/352065098472488960/465373705846128660" + runs-on: ubuntu-latest + steps: + - name: discord-moonlight + uses: sarisia/actions-status-discord@eb045afee445dc055c18d3d90bd0f244fd062708 # v1.16.0 + with: + avatar_url: ${{ vars.ORG_LOGO_URL }}256 + color: 0x${{ vars.COLOR_HEX_GREEN }} + nodetail: true + nofail: false + title: ${{ github.event.issue.title }} + url: ${{ github.event.issue.body }} + username: ${{ vars.DISCORD_USERNAME }} + webhook: ${{ secrets.DISCORD_RELEASE_WEBHOOK_MOONLIGHT }} + facebook: if: needs.authorize.outputs.authorized == 'true' needs: authorize @@ -108,6 +154,8 @@ jobs: needs: - authorize - discord + - discord-moonlight + - moonlight-conditions - facebook - reddit runs-on: ubuntu-latest @@ -133,6 +181,13 @@ jobs: | Facebook | $(get_emoji "${{ needs.facebook.result }}") | ${{ needs.facebook.outputs.post-url }} | | Reddit | $(get_emoji "${{ needs.reddit.result }}") | ${{ needs.reddit.outputs.post-url }} |" + if [ "${{ needs.moonlight-conditions.outputs.post }}" == "true" ]; then + moonlight_status="${{ needs.discord-moonlight.result }}" + moonlight_url="${{ needs.discord-moonlight.outputs.post-url }}" + comment="${comment} + | Discord Moonlight | $(get_emoji "${moonlight_status}") | ${moonlight_url} |" + fi + close_reason="completed" lock_reason="resolved"