use pr list subcommand for pull request search

This commit is contained in:
dkanada
2026-03-17 22:15:30 +09:00
parent fdd68d468e
commit f7380aefd1
+1 -1
View File
@@ -25,7 +25,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
run: |
API_RESPONSE=$(gh api "repos/${GITHUB_REPOSITORY}/commits/${HEAD_SHA}/pulls")
API_RESPONSE=$(gh pr list --repo "${GITHUB_REPOSITORY}" --search "${HEAD_SHA}" --state open --json number)
PR_NUMBER=$(echo "${API_RESPONSE}" | jq '.[0].number')
echo "repository: ${GITHUB_REPOSITORY}"