From 7772c6367efcc856a49fe02de8cc7ef9afc8bba8 Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Sun, 11 Jun 2023 01:00:22 +0200 Subject: [PATCH] debug: Retry using commit SHA --- .github/workflows/seo-report.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/seo-report.yaml b/.github/workflows/seo-report.yaml index 4291c41..6f26359 100644 --- a/.github/workflows/seo-report.yaml +++ b/.github/workflows/seo-report.yaml @@ -34,9 +34,12 @@ jobs: - name: Get Deployment Source Branch Name id: git-branch run: | + commit_sha=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + "https://api.github.com/repos/${{ github.repository }}/deployments/${{ github.event.deployment.id }}" \ + | jq -r '.sha') 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-) + "https://api.github.com/repos/${{ github.repository }}/commits/$commit_sha" \ + | jq -r '.ref' | sed 's/refs\/heads\///') echo "Source branch of deployment: $branch" echo "SOURCE_REF=$branch" >> "$GITHUB_ENV"