From 0eedfec66701556690e301d93c55d1fb504b4d9b Mon Sep 17 00:00:00 2001 From: Ben Allfree Date: Sat, 9 Aug 2025 19:25:42 -0700 Subject: [PATCH] chore(root): GA permalink & URL optimize --- .github/workflows/publish-dashboard.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-dashboard.yaml b/.github/workflows/publish-dashboard.yaml index 7e38e1ec..4d76b75e 100644 --- a/.github/workflows/publish-dashboard.yaml +++ b/.github/workflows/publish-dashboard.yaml @@ -18,6 +18,9 @@ on: env: PUBLIC_APEX_DOMAIN: ${{ vars.PUBLIC_APEX_DOMAIN }} MAIN_BRANCH: main + BRANCH_NAME: ${{ github.event.pull_request.head.ref || github.ref_name }} + GITHUB_LINK: ${{ github.event_name == 'pull_request_target' && format('https://github.com/{0}/pull/{1}', github.repository, github.event.pull_request.number) || format('https://github.com/{0}/tree/{1}', github.repository, github.event.pull_request.head.ref || github.ref_name) }} + COMMIT_URL: ${{ github.event_name == 'pull_request_target' && format('https://github.com/{0}/pull/{1}/commits/{2}', github.repository, github.event.pull_request.number, github.sha) || format('https://github.com/{0}/commit/{1}', github.repository, github.sha) }} jobs: publish: @@ -73,6 +76,7 @@ jobs: header: pockethost-dashboard-preview message: | ✅ HEAD preview (updated at each push): ${{ steps.deployment.outputs.deployment-alias-url }} + ✅ Permalink preview (updated at each push): ${{ steps.deployment.outputs.deployment-alias-url }} Triggered by @${{ github.actor }} on `${{ github.event.pull_request.head.ref }}`. - name: Discord feature branch notification @@ -81,7 +85,7 @@ jobs: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} uses: Ilshidur/action-discord@master with: - args: '**DASHBOARD PREVIEW** ${{ steps.deployment.outputs.pages-deployment-alias-url }} was generated by ${{ github.actor }} in [${{ env.GIT_COMMIT_SHORT_SHA }}](https://github.com/${{ github.repository}}/commit/${{ github.sha }}) on [${{ github.repository}}#${{ github.event.pull_request.head.ref || github.ref_name }}](https://github.com/${{ github.repository}}/tree/${{ github.event.pull_request.head.ref || github.ref_name }}) with memo `${{ env.GIT_COMMIT_MESSAGE_SUBJECT }}`' + args: '**DASHBOARD PREVIEW** ${{ steps.deployment.outputs.pages-deployment-alias-url }} was generated by ${{ github.actor }} in [${{ env.GIT_COMMIT_SHORT_SHA }}](${{ env.COMMIT_URL }}) on [${{ github.repository}}@${{ env.BRANCH_NAME }}](${{ env.GITHUB_LINK }}) with memo `${{ env.GIT_COMMIT_MESSAGE_SUBJECT }}`' - name: Discord live branch notification if: github.event_name == 'push' && github.ref_name == env.MAIN_BRANCH @@ -89,4 +93,4 @@ jobs: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} uses: Ilshidur/action-discord@master with: - args: '**DASHBOARD LIVE** https://pockethost.io ([permalink](${{ steps.deployment.outputs.deployment-alias-url }})) was updated by ${{ github.actor }} in [${{ env.GIT_COMMIT_SHORT_SHA }}](https://github.com/${{ github.repository}}/commit/${{ github.sha }}) on [${{ github.repository}}#${{ github.ref_name }}](https://github.com/${{ github.repository}}/tree/${{ github.ref_name }}): `${{ env.GIT_COMMIT_MESSAGE_SUBJECT }}`' + args: '**DASHBOARD LIVE** https://pockethost.io ([permalink](${{ steps.deployment.outputs.deployment-url }})) was updated by ${{ github.actor }} in [${{ env.GIT_COMMIT_SHORT_SHA }}](${{ env.COMMIT_URL }}) on [${{ github.repository}}@${{ env.BRANCH_NAME }}](${{ env.GITHUB_LINK }}): `${{ env.GIT_COMMIT_MESSAGE_SUBJECT }}`'