diff --git a/.github/scripts/notify-embed.js b/.github/scripts/notify-embed.js index 1cdef5de..2326c49b 100644 --- a/.github/scripts/notify-embed.js +++ b/.github/scripts/notify-embed.js @@ -1,4 +1,4 @@ -const platforms = () => { +const getPlatforms = () => { const platforms = []; const { ENABLE_ANDROID, @@ -20,11 +20,18 @@ const platforms = () => { return "None"; }; -const changelog = () => { - return process.env.CHANGELOG ?? "No Documented Changes"; +const getChangelog = () => { + if (process.env.CHANGELOG) return process.env.CHANGELOG; + return "No Documented Changes"; }; -const web = () => { +const getRelease = () => { + let url = "https://builds.lunasea.app"; + if (process.env.BUILD_TITLE) url += `/#${process.env.BUILD_TITLE}/`; + return `[Download](${url})`; +}; + +const getWeb = () => { let url = ""; if (process.env.FLAVOR !== "stable") url += `${process.env.FLAVOR}.`; url += "web.lunasea.app"; @@ -40,21 +47,21 @@ module.exports = () => { fields: [ { name: "Release", - value: `[Download](https://builds.lunasea.app/#${process.env.BUILD_TITLE}/)`, + value: getRelease(), inline: true, }, { name: "Web", - value: web(), + value: getWeb(), inline: true, }, { name: "Platforms", - value: platforms(), + value: getPlatforms(), }, { name: "Changelog", - value: changelog(), + value: getChangelog(), }, ], }, diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index c8c9f3eb..52360e90 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -46,7 +46,11 @@ jobs: name: Discord runs-on: ubuntu-latest steps: - + - name: Checkout Repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Determine Webhook Channel id: webhook uses: actions/github-script@v6