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: |