From 4308caddf1fde073c9b70bb56075d6f32cdb13ed Mon Sep 17 00:00:00 2001 From: Carlos Polop Date: Mon, 19 Jan 2026 00:10:42 +0100 Subject: [PATCH] Fix PR context parsing in failure dispatch --- .../workflows/pr-failure-codex-dispatch.yml | 29 ++++++------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/.github/workflows/pr-failure-codex-dispatch.yml b/.github/workflows/pr-failure-codex-dispatch.yml index 86a2a71..3676b10 100644 --- a/.github/workflows/pr-failure-codex-dispatch.yml +++ b/.github/workflows/pr-failure-codex-dispatch.yml @@ -26,26 +26,15 @@ jobs: PR_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number }} GH_TOKEN: ${{ github.token }} run: | - pr_json=$(gh api -H "Accept: application/vnd.github+json" \ - /repos/${{ github.repository }}/pulls/${PR_NUMBER}) - pr_author=$(printf "%s" "$pr_json" | python3 - <<'PY' - import json,sys - data=json.load(sys.stdin) - print(data.get("user",{}).get("login","")) - PY - ) - 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 - ) + pr_author=$(gh api -H "Accept: application/vnd.github+json" \ + /repos/${{ github.repository }}/pulls/${PR_NUMBER} \ + --jq '.user.login') + pr_head_repo=$(gh api -H "Accept: application/vnd.github+json" \ + /repos/${{ github.repository }}/pulls/${PR_NUMBER} \ + --jq '.head.repo.full_name') + pr_head_branch=$(gh api -H "Accept: application/vnd.github+json" \ + /repos/${{ github.repository }}/pulls/${PR_NUMBER} \ + --jq '.head.ref') { echo "number=${PR_NUMBER}" echo "author=${pr_author}"