Compare commits

..

1 Commits

Author SHA1 Message Date
Carlos Polop
08c4c6fc1d Fix PR author detection for failure dispatch 2026-01-19 00:05:31 +01:00

View File

@@ -26,15 +26,26 @@ jobs:
PR_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number }} PR_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number }}
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}
run: | run: |
pr_author=$(gh api -H "Accept: application/vnd.github+json" \ pr_json=$(gh api -H "Accept: application/vnd.github+json" \
/repos/${{ github.repository }}/pulls/${PR_NUMBER} \ /repos/${{ github.repository }}/pulls/${PR_NUMBER})
--jq '.user.login') pr_author=$(printf "%s" "$pr_json" | python3 - <<'PY'
pr_head_repo=$(gh api -H "Accept: application/vnd.github+json" \ import json,sys
/repos/${{ github.repository }}/pulls/${PR_NUMBER} \ data=json.load(sys.stdin)
--jq '.head.repo.full_name') print(data.get("user",{}).get("login",""))
pr_head_branch=$(gh api -H "Accept: application/vnd.github+json" \ PY
/repos/${{ github.repository }}/pulls/${PR_NUMBER} \ )
--jq '.head.ref') pr_head_repo=$(printf "%s" "$pr_json" | python3 - <<'PY'
import json,sys
data=json.load(sys.stdin)
print(data.get("head",{}).get("repo",{}).get("full_name",""))
PY
)
pr_head_branch=$(printf "%s" "$pr_json" | python3 - <<'PY'
import json,sys
data=json.load(sys.stdin)
print(data.get("head",{}).get("ref",""))
PY
)
{ {
echo "number=${PR_NUMBER}" echo "number=${PR_NUMBER}"
echo "author=${pr_author}" echo "author=${pr_author}"