From 9d3bbc281ff20d509a293a4540b11972c03a23a3 Mon Sep 17 00:00:00 2001
From: Bart van der Braak <bartvdbraak@gmail.com>
Date: Sun, 11 Jun 2023 00:40:09 +0200
Subject: [PATCH] debug: Retrieve related branch

---
 .github/workflows/seo-report.yaml | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/seo-report.yaml b/.github/workflows/seo-report.yaml
index 2215589..03e92b8 100644
--- a/.github/workflows/seo-report.yaml
+++ b/.github/workflows/seo-report.yaml
@@ -17,7 +17,7 @@ jobs:
     if: github.event.deployment_status.state == 'success'
     environment:
       name: github-pages
-      url: https://${{ github.repository_owner }}.github.io/${{ github.repository }}/${{ github.event.repository.name }}/${{ github.head_ref }}
+      url: https://${{ github.repository_owner }}.github.io/${{ github.head_ref }}/
     runs-on: ubuntu-latest
     steps:
       - name: Check out
@@ -31,6 +31,16 @@ jobs:
       - name: Install Dependencies
         run: yarn global add @unlighthouse/cli puppeteer
 
+      - name: Get Deployment Source Branch Name
+        id: git-branch
+        run: |
+           git branch -a --contains ${{ github.event.deployment.ref }}
+           source_branches="$(git branch -a --contains ${{ github.event.deployment.ref }})"
+           result=$(echo "$source_branches" | tail -n1 | sed 's/^[ \t]*//')
+           echo "Remote source of deployment: ${result}"
+           echo "Local git ref of deployment: ${result#remotes/origin/*}"
+           echo "SOURCE_REF=${result#remotes/origin/*}" >> "$GITHUB_OUTPUT"
+
       - name: Build Unlighthouse report
         run: |
           unlighthouse-ci \