diff --git a/.github/workflows/_security.yml b/.github/workflows/_security.yml index 7232d8745..dd6f3400c 100644 --- a/.github/workflows/_security.yml +++ b/.github/workflows/_security.yml @@ -42,7 +42,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 240 steps: - - name: Wait for CodeQL on current commit (max 45 min) + - name: Wait for CodeQL on current commit (max 150 min) env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | @@ -50,11 +50,17 @@ jobs: # CodeQL runs are recorded against the PR head SHA. CURRENT_SHA="${{ github.event.pull_request.head.sha || github.sha }}" echo "Waiting for CodeQL to complete on $CURRENT_SHA..." - for attempt in $(seq 1 90); do + # 300 attempts x 30s = 150 min. The previous budget was 90 x 30s = 45 min, + # which is shorter than CodeQL actually takes on this repository: a measured + # run on PR #1426 (head 7b72652a) completed with conclusion=success after + # 124 min, 7 minutes AFTER this gate had already given up. That marked at + # least five contributor PRs red for a scan that passed. The job's own + # timeout-minutes is 240, so 150 still leaves headroom. + for attempt in $(seq 1 300); do LATEST=$(gh api "repos/${{ github.repository }}/actions/workflows/codeql.yml/runs?head_sha=$CURRENT_SHA&per_page=1" \ --jq '.workflow_runs[] | "\(.conclusion) \(.status)"' 2>/dev/null | head -1 || echo "") if [ -z "$LATEST" ]; then - echo " $attempt/90: no run yet..."; sleep 30; continue + echo " $attempt/300: no run yet..."; sleep 30; continue fi CONCLUSION=$(echo "$LATEST" | cut -d' ' -f1) STATUS=$(echo "$LATEST" | cut -d' ' -f2) @@ -63,7 +69,7 @@ jobs: elif [ "$STATUS" = "completed" ]; then echo "BLOCKED: CodeQL $CONCLUSION"; exit 1 fi - echo " $attempt/90: $STATUS..."; sleep 30 + echo " $attempt/300: $STATUS..."; sleep 30 done echo "BLOCKED: CodeQL timeout"; exit 1