diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index b325ebdcf3..ec093e0965 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -38,22 +38,22 @@ jobs: echo ${{ secrets.AZURE_DEVOPS_EXT_PAT }} | az devops login --org ${{ secrets.AZURE_PIPELINE_ORG }} echo "Sanity check recently triggered Merge Queue Pipeline runs" - az pipelines runs list --pipeline-ids ${{ secrets.AZURE_PIPELINE_ID }} --org ${{ secrets.AZURE_PIPELINE_ORG }} --project ${{ secrets.AZURE_PIPELINE_PROJECT }} --reason individualCI --top 10 --output json | jq -r .[].sourceBranch - status=`az pipelines runs list --pipeline-ids ${{ secrets.AZURE_PIPELINE_ID }} --org ${{ secrets.AZURE_PIPELINE_ORG }} --project ${{ secrets.AZURE_PIPELINE_PROJECT }} --top 1 --branch $GITHUB_REF --output json | jq -r .[].status` + az pipelines runs list --pipeline-ids ${{ secrets.AZURE_PIPELINE_ID }} --org ${{ secrets.AZURE_PIPELINE_ORG }} --project ${{ secrets.AZURE_PIPELINE_PROJECT }} --reason individualCI --top 10 --query-order QueueTimeDesc --output json | jq -r .[].sourceBranch + status=`az pipelines runs list --pipeline-ids ${{ secrets.AZURE_PIPELINE_ID }} --org ${{ secrets.AZURE_PIPELINE_ORG }} --project ${{ secrets.AZURE_PIPELINE_PROJECT }} --top 1 --branch $GITHUB_REF --query-order QueueTimeDesc --output json | jq -r .[].status` echo "Triggered CI Status - $status" echo "Branch Ref - $GITHUB_REF" echo "Checking for AZP triggered CI for 60s" end=$((SECONDS+60)) # Stop checking if not queued within a minute while [ $SECONDS -lt $end ]; do + echo "Waiting for 5 seconds for AZP to trigger run and show inProgress or notStarted" + sleep 5s + status=`az pipelines runs list --pipeline-ids ${{ secrets.AZURE_PIPELINE_ID }} --org ${{ secrets.AZURE_PIPELINE_ORG }} --project ${{ secrets.AZURE_PIPELINE_PROJECT }} --top 1 --branch $GITHUB_REF --query-order QueueTimeDesc --output json | jq -r .[].status` + echo "Current CI Status - $status" if [ $status = 'inProgress' ] || [ $status = 'notStarted' ]; then echo "AZP triggered pipeline queued successfully" exit 0 fi - echo "Waiting for 15 seconds for AZP to trigger run and show inProgress or notStarted" - sleep 15s - status=`az pipelines runs list --pipeline-ids ${{ secrets.AZURE_PIPELINE_ID }} --org ${{ secrets.AZURE_PIPELINE_ORG }} --project ${{ secrets.AZURE_PIPELINE_PROJECT }} --top 1 --branch $GITHUB_REF --output json | jq -r .[].status` - echo "Current CI Status - $status" done echo "AZP did not trigger CI" @@ -66,7 +66,7 @@ jobs: while [ $SECONDS -lt $end ]; do echo "Waiting for 5 seconds for pipeline to show inProgress or notStarted on AZP" sleep 5s - status=`az pipelines runs list --pipeline-ids ${{ secrets.AZURE_PIPELINE_ID }} --org ${{ secrets.AZURE_PIPELINE_ORG }} --project ${{ secrets.AZURE_PIPELINE_PROJECT }} --top 1 --branch $GITHUB_REF --output json | jq -r .[].status` + status=`az pipelines runs list --pipeline-ids ${{ secrets.AZURE_PIPELINE_ID }} --org ${{ secrets.AZURE_PIPELINE_ORG }} --project ${{ secrets.AZURE_PIPELINE_PROJECT }} --top 1 --branch $GITHUB_REF --query-order QueueTimeDesc --output json | jq -r .[].status` echo "Current CI Status - $status" if [ $status = 'inProgress' ] || [ $status = 'notStarted' ]; then echo "Manually triggered pipeline queued successfully"