diff --git a/.github/workflows/update-status/action.yml b/.github/workflows/update-status/action.yml index 4009860..f3d2e32 100644 --- a/.github/workflows/update-status/action.yml +++ b/.github/workflows/update-status/action.yml @@ -14,14 +14,24 @@ runs: - run: | set -x if [ -n ${{ inputs.sha }} ]; then - GH_TOKEN=${{ github.token }} gh api \ + export GH_TOKEN=${{ github.token }} + gh api \ --method POST \ -H "Accept: application/vnd.github+json" \ -H "X-GitHub-Api-Version: 2022-11-28" \ /repos/${{ github.repository }}/statuses/${{ inputs.sha }} \ -f "state=${{ inputs.state }}" -f "context=actions-sync" - html_url=$(curl -f -s -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ github.token }}" https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs | jq . | tee /dev/stderr | jq '.jobs[] | select (.name == ${{ env.GITHUB_JOB }}) | .html_url') + html_url=$(gh api \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + /repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs | jq . | tee /dev/stderr | jq '.jobs[] | select (.name == ${{ github.job }}) | .html_url') + + echo $html_url + + html_url=$(curl -f -s -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ github.token }}" https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs | jq . | tee /dev/stderr | jq '.jobs[] | select (.name == ${{ github.job }}) | .html_url') + + echo $html_url # curl -f -X POST -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ github.token }}" https://api.github.com/repos/${{ github.repository }}/statuses/${{ inputs.sha }} -d '{"state": "${{ inputs.state }}", "context": "${{ github.workflow }} / ${{ github.job }}", "target_url": '${html_url}' }' fi