Skip to content

Commit 105069b

Browse files
authored
Merge pull request #1960 from DeusData/ci/codeql-gate-budget-v2
ci(security): raise the codeql-gate wait from 45 to 150 minutes
2 parents 011087e + 77063bc commit 105069b

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/_security.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,25 @@ jobs:
4242
runs-on: ubuntu-latest
4343
timeout-minutes: 240
4444
steps:
45-
- name: Wait for CodeQL on current commit (max 45 min)
45+
- name: Wait for CodeQL on current commit (max 150 min)
4646
env:
4747
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4848
run: |
4949
# On pull_request events github.sha is the synthetic merge commit;
5050
# CodeQL runs are recorded against the PR head SHA.
5151
CURRENT_SHA="${{ github.event.pull_request.head.sha || github.sha }}"
5252
echo "Waiting for CodeQL to complete on $CURRENT_SHA..."
53-
for attempt in $(seq 1 90); do
53+
# 300 attempts x 30s = 150 min. The previous budget was 90 x 30s = 45 min,
54+
# which is shorter than CodeQL actually takes on this repository: a measured
55+
# run on PR #1426 (head 7b72652a) completed with conclusion=success after
56+
# 124 min, 7 minutes AFTER this gate had already given up. That marked at
57+
# least five contributor PRs red for a scan that passed. The job's own
58+
# timeout-minutes is 240, so 150 still leaves headroom.
59+
for attempt in $(seq 1 300); do
5460
LATEST=$(gh api "repos/${{ github.repository }}/actions/workflows/codeql.yml/runs?head_sha=$CURRENT_SHA&per_page=1" \
5561
--jq '.workflow_runs[] | "\(.conclusion) \(.status)"' 2>/dev/null | head -1 || echo "")
5662
if [ -z "$LATEST" ]; then
57-
echo " $attempt/90: no run yet..."; sleep 30; continue
63+
echo " $attempt/300: no run yet..."; sleep 30; continue
5864
fi
5965
CONCLUSION=$(echo "$LATEST" | cut -d' ' -f1)
6066
STATUS=$(echo "$LATEST" | cut -d' ' -f2)
@@ -63,7 +69,7 @@ jobs:
6369
elif [ "$STATUS" = "completed" ]; then
6470
echo "BLOCKED: CodeQL $CONCLUSION"; exit 1
6571
fi
66-
echo " $attempt/90: $STATUS..."; sleep 30
72+
echo " $attempt/300: $STATUS..."; sleep 30
6773
done
6874
echo "BLOCKED: CodeQL timeout"; exit 1
6975

0 commit comments

Comments
 (0)