debug: Retrieve related branch

This commit is contained in:
Bart van der Braak 2023-06-11 00:40:09 +02:00
parent 5f951d73ed
commit 9d3bbc281f

View file

@ -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 \