Try fix the max-parallel for maunally triggered test again. (#18686)
This commit is contained in:
@@ -209,10 +209,20 @@ jobs:
|
|||||||
elif [[ "${{ github.event_name }}" == "pull_request" && "${{ contains(github.event.pull_request.labels.*.name, 'high priority') }}" == "true" ]]; then
|
elif [[ "${{ github.event_name }}" == "pull_request" && "${{ contains(github.event.pull_request.labels.*.name, 'high priority') }}" == "true" ]]; then
|
||||||
echo "max_parallel=14" >> $GITHUB_OUTPUT
|
echo "max_parallel=14" >> $GITHUB_OUTPUT
|
||||||
echo "High priority PR detected, setting max_parallel to 14"
|
echo "High priority PR detected, setting max_parallel to 14"
|
||||||
elif [[ -n "${{ inputs.pr_head_sha }}" ]]; then
|
elif [[ -n "${{ inputs.target_stage }}" ]]; then
|
||||||
# /rerun-stage (workflow_dispatch): query PR labels via GitHub API
|
# /rerun-stage (workflow_dispatch): query PR labels via GitHub API
|
||||||
LABELS=$(gh api "repos/${{ github.repository }}/commits/${{ inputs.pr_head_sha }}/pulls" \
|
# Try SHA lookup first (fork PRs), fallback to branch name (non-fork PRs)
|
||||||
|
LABELS=""
|
||||||
|
PR_HEAD_SHA="${{ inputs.pr_head_sha }}"
|
||||||
|
if [[ -n "$PR_HEAD_SHA" ]]; then
|
||||||
|
LABELS=$(gh api "repos/${{ github.repository }}/commits/${PR_HEAD_SHA}/pulls" \
|
||||||
--jq '.[0].labels[].name' 2>/dev/null || true)
|
--jq '.[0].labels[].name' 2>/dev/null || true)
|
||||||
|
fi
|
||||||
|
if [[ -z "$LABELS" ]]; then
|
||||||
|
LABELS=$(gh pr list --head "${{ github.ref_name }}" --repo "${{ github.repository }}" \
|
||||||
|
--json labels --jq '.[0].labels[].name' 2>/dev/null || true)
|
||||||
|
fi
|
||||||
|
echo "PR labels: ${LABELS:-"(none)"}"
|
||||||
if echo "$LABELS" | grep -Fxq "high priority"; then
|
if echo "$LABELS" | grep -Fxq "high priority"; then
|
||||||
echo "max_parallel=14" >> $GITHUB_OUTPUT
|
echo "max_parallel=14" >> $GITHUB_OUTPUT
|
||||||
echo "High priority PR detected via API (/rerun-stage), setting max_parallel to 14"
|
echo "High priority PR detected via API (/rerun-stage), setting max_parallel to 14"
|
||||||
|
|||||||
Reference in New Issue
Block a user