Skip to content

Commit c463a89

Browse files
committed
fix validation
1 parent 5526709 commit c463a89

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

.github/workflows/update-nuspec.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
env:
2525
GH_TOKEN: ${{ secrets.PAT }}
2626
WORKFLOW_EVENT: ${{ github.event.workflow_run.event }}
27+
HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
2728
run: |
2829
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
2930
echo "[skip] workflow_dispatch"
@@ -37,15 +38,14 @@ jobs:
3738
exit 0
3839
fi
3940
40-
PR_JSON=$(gh pr list --repo ${{ github.repository }} --state all --json number,mergeCommit,headRefName,baseRefName,state --search "$HEAD_SHA" --limit 1)
41+
PR_JSON=$(gh pr list --repo ${{ github.repository }} --state all --json number,mergeCommit,headRefName,baseRefName,state --search "$HEAD_SHA" --limit 1 --jq '.[0]')
4142
if [ "$(echo "$PR_JSON" | jq '. | length')" -eq 0 ]; then
4243
echo "[skip] No PR found for commit $HEAD_SHA"
4344
echo "pull_request_merged=false" >> $GITHUB_OUTPUT
4445
echo "pull_request_head_ref=" >> $GITHUB_OUTPUT
4546
exit 0
4647
fi
4748
48-
PR_JSON=$(gh pr view "$PR_NUMBER" --repo ${{ github.repository }} --json headRefName,baseRefName,state)
4949
PR_STATE=$(echo "$PR_JSON" | jq -r '.state')
5050
PR_BASE_REF_NAME=$(echo "$PR_JSON" | jq -r '.baseRefName')
5151
PR_HEAD_REF=$(echo "$PR_JSON" | jq -r '.headRefName')

0 commit comments

Comments
 (0)