debug: Retrieve through the use of GitHub API

This commit is contained in:
Bart van der Braak 2023-06-11 00:51:51 +02:00
parent 9d3bbc281f
commit 4dd7664f29

View file

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