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 - name: Get Deployment Source Branch Name
id: git-branch id: git-branch
run: | run: |
git branch -a --contains ${{ github.event.deployment.ref }} branch=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
source_branches="$(git branch -a --contains ${{ github.event.deployment.ref }})" "https://api.github.com/repos/${{ github.repository }}/deployments/${{ github.event.deployment.id }}" \
result=$(echo "$source_branches" | tail -n1 | sed 's/^[ \t]*//') | jq -r '.ref' | cut -d "/" -f 3-)
echo "Remote source of deployment: ${result}" echo "Source branch of deployment: $branch"
echo "Local git ref of deployment: ${result#remotes/origin/*}" echo "SOURCE_REF=$branch" >> "$GITHUB_ENV"
echo "SOURCE_REF=${result#remotes/origin/*}" >> "$GITHUB_OUTPUT"
- name: Build Unlighthouse report - name: Build Unlighthouse report
run: | run: |