From 4dd7664f29af7babe01bef1c26f635cffcbec448 Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Sun, 11 Jun 2023 00:51:51 +0200 Subject: [PATCH] debug: Retrieve through the use of GitHub API --- .github/workflows/seo-report.yaml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/seo-report.yaml b/.github/workflows/seo-report.yaml index 03e92b8..4291c41 100644 --- a/.github/workflows/seo-report.yaml +++ b/.github/workflows/seo-report.yaml @@ -34,12 +34,11 @@ jobs: - 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" + branch=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + "https://api.github.com/repos/${{ github.repository }}/deployments/${{ github.event.deployment.id }}" \ + | jq -r '.ref' | cut -d "/" -f 3-) + echo "Source branch of deployment: $branch" + echo "SOURCE_REF=$branch" >> "$GITHUB_ENV" - name: Build Unlighthouse report run: |