From ba42cfa88aab08c118adfcbb76c18449665c2e62 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Sun, 24 Dec 2023 16:28:26 -0500 Subject: [PATCH] fix(servers): put correct url in embed title --- .forgejo/workflows/discord.yml | 9 ++++----- common/pkgs/discommit/index.ts | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.forgejo/workflows/discord.yml b/.forgejo/workflows/discord.yml index a1c1034..67c0cbd 100644 --- a/.forgejo/workflows/discord.yml +++ b/.forgejo/workflows/discord.yml @@ -1,11 +1,8 @@ name: Discord on: - workflow_dispatch: - push: - paths: - - 'devices/oksys/*' - - 'devices/servivi/*' + - workflow_dispatch + - push jobs: discord_commits: @@ -14,6 +11,8 @@ jobs: env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + if: contains(github.event.head_commit.message, '(servers)') + steps: - name: Checkout uses: https://github.com/actions/checkout@v3 diff --git a/common/pkgs/discommit/index.ts b/common/pkgs/discommit/index.ts index f9a4a32..a33694d 100644 --- a/common/pkgs/discommit/index.ts +++ b/common/pkgs/discommit/index.ts @@ -15,13 +15,13 @@ const commit = JSON.stringify({ embeds: [{ title: 'New commit containing changes to server configs:', description: commitInfo.commit.message, - url: commitInfo.url, + url: commitInfo.html_url, author: { name: commitInfo.author.username, icon_url: commitInfo.author.avatar_url, }, }], - // Diff: await (await fetch(`${last['url']}.diff`)).text() + // Diff: await (await fetch(`${commitInfo.url}.diff`)).text() }); const post = await fetch(`${DATA.webhook}?wait=true`, {