File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -302,6 +302,8 @@ jobs:
302302 environment : ${{ steps.check_status.outputs.build_environment }}
303303 steps :
304304 - id : check_status
305+ env :
306+ GH_TOKEN : ${{ github.token }}
305307 run : |
306308 if [[ "${{ needs.BUILD.result }}" == "success" && "${{ needs.BOOTSTRAP.result }}" == "success" ]]; then
307309 printf "%s\n" "build_success=true" >> "$GITHUB_OUTPUT"
@@ -323,7 +325,14 @@ jobs:
323325 if [[ "${{ github.event_name }}" == "pull_request" ]]; then
324326 printf "%s\n" "build_pr_number=${{ github.event.pull_request.number }}" >> $GITHUB_OUTPUT
325327 else
326- printf "%s\n" "build_pr_number=null" >> $GITHUB_OUTPUT
328+ PRS_LIST=$(gh pr list --state open --head "${{ github.repository }}:${{ github.ref_name }}" --json number --jq '.[].number')
329+ # Determine the highest pull request number or set to null
330+ if [[ -n "${PRS_LIST}" ]]; then
331+ highest_pr_number=$(printf "%s\n" "$PRS_LIST" | sort -n | tail -n 1)
332+ echo "build_pr_number=$highest_pr_number" >> $GITHUB_OUTPUT
333+ else
334+ echo "build_pr_number=null" >> $GITHUB_OUTPUT
335+ fi
327336 fi
328337 printf "%s\n" "build_environment=${ENVIRONMENT}" >> "$GITHUB_OUTPUT"
329338 printf "%s\n" "build_id=${{ github.run_id }}" >> "$GITHUB_OUTPUT"
You can’t perform that action at this time.
0 commit comments