ci: no change-detection or reachability checkout can run into the one-minute limit (#6577)

* ci: change detection fetches the history its diffs read, not every branch and tag

The Detect changes job checked out with fetch-depth 0, which fetches all 1,400
branches and 670 tags to diff two commits; twice that stalled for the whole
minute and took a pull request out of the merge queue. It now checks out the
commit and fetches its ancestry and main without file contents.

* ci: no change-detection or reachability checkout can run into the one-minute limit

The Detect changes jobs of four workflows and the reachability job kept a
one-minute checkout limit with a retry; two of them hit it together and took a
pull request out of the merge queue. Each now has one checkout with three
minutes, change detection shares one fetch-history step, and the reachability
job, which reads only the base commit, fetches two commits deep.
This commit is contained in:
Miguel Ángel
2026-10-27 19:28:56 +00:00
committed by GitHub
parent 957df5c268
commit 7fea875ede
5 changed files with 39 additions and 64 deletions
+11
View File
@@ -0,0 +1,11 @@
name: Fetch history
description: >-
Fetches this commit's ancestry and main without file contents, so the change-detection diffs run on a shallow
checkout. The diffs read no other branch or tag. Needs a checkout first.
runs:
using: composite
steps:
- shell: bash
run: |
git fetch --no-tags --filter=blob:none --unshallow origin "$(git rev-parse HEAD)"
git fetch --no-tags --filter=blob:none origin +refs/heads/main:refs/remotes/origin/main
+10 -25
View File
@@ -39,20 +39,12 @@ jobs:
test-reachability:
name: Test reachability
runs-on: ubuntu-latest
timeout-minutes: 4
timeout-minutes: 6
steps:
# A history fetch now and then stalls until the job's limit; a second fetch gets through.
- id: checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
timeout-minutes: 1
continue-on-error: true
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
timeout-minutes: 3
with:
fetch-depth: 0
- if: steps.checkout.outcome != 'success'
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
timeout-minutes: 1
with:
fetch-depth: 0
fetch-depth: 2
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
@@ -73,7 +65,7 @@ jobs:
changes:
name: Detect changes
runs-on: ubuntu-latest
timeout-minutes: 4
timeout-minutes: 8
permissions:
actions: read
contents: read
@@ -94,18 +86,11 @@ jobs:
# Force git-based change detection instead of the pull_request REST API.
# The API path can fail the whole workflow on transient listFiles
# timeouts before any real CI work starts.
# A history fetch now and then stalls until the job's limit; a second fetch gets through.
- id: checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
timeout-minutes: 1
continue-on-error: true
with:
fetch-depth: 0
- if: steps.checkout.outcome != 'success'
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
timeout-minutes: 1
with:
fetch-depth: 0
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
timeout-minutes: 3
- name: Fetch the history the diffs read
timeout-minutes: 2
uses: ./.github/actions/fetch-history
- name: Check whether this commit already passed before a title or body edit
id: edit
uses: ./.github/actions/edit-already-passed
+6 -13
View File
@@ -21,24 +21,17 @@ jobs:
changes:
name: Detect changes
runs-on: ubuntu-latest
timeout-minutes: 4
timeout-minutes: 8
outputs:
perf: ${{ steps.release.outputs.release_only == 'true' && 'false' || steps.filter.outputs.perf }}
steps:
# Force git-based change detection instead of the pull_request REST API.
# The API path can fail the perf workflow on transient listFiles timeouts.
# A history fetch now and then stalls until the job's limit; a second fetch gets through.
- id: checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
timeout-minutes: 1
continue-on-error: true
with:
fetch-depth: 0
- if: steps.checkout.outcome != 'success'
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
timeout-minutes: 1
with:
fetch-depth: 0
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
timeout-minutes: 3
- name: Fetch the history the diffs read
timeout-minutes: 2
uses: ./.github/actions/fetch-history
# HEAD is the PR merge ref; its first parent is the current base tip, unlike the payload's
# base.sha, which goes stale and would count the base's newer commits as the PR's changes.
- name: Find the pull request's current base
+6 -13
View File
@@ -39,7 +39,7 @@ jobs:
changes:
name: Detect changes
runs-on: ubuntu-latest
timeout-minutes: 4
timeout-minutes: 8
permissions:
actions: read
contents: read
@@ -50,18 +50,11 @@ jobs:
# Force git-based change detection instead of the pull_request REST API.
# The API path can fail the whole workflow on transient listFiles
# timeouts before any regression shard even starts.
# A history fetch now and then stalls until the job's limit; a second fetch gets through.
- id: checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
timeout-minutes: 1
continue-on-error: true
with:
fetch-depth: 0
- if: steps.checkout.outcome != 'success'
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
timeout-minutes: 1
with:
fetch-depth: 0
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
timeout-minutes: 3
- name: Fetch the history the diffs read
timeout-minutes: 2
uses: ./.github/actions/fetch-history
- name: Check whether this commit already passed before a title or body edit
id: edit
uses: ./.github/actions/edit-already-passed
+6 -13
View File
@@ -43,7 +43,7 @@ jobs:
changes:
name: Detect changes
runs-on: ubuntu-latest
timeout-minutes: 4
timeout-minutes: 8
permissions:
actions: read
contents: read
@@ -53,18 +53,11 @@ jobs:
# Force git-based change detection instead of the pull_request REST API.
# The API path can fail the workflow on transient listFiles timeouts
# before the Windows render jobs even start.
# A history fetch now and then stalls until the job's limit; a second fetch gets through.
- id: checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
timeout-minutes: 1
continue-on-error: true
with:
fetch-depth: 0
- if: steps.checkout.outcome != 'success'
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
timeout-minutes: 1
with:
fetch-depth: 0
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
timeout-minutes: 3
- name: Fetch the history the diffs read
timeout-minutes: 2
uses: ./.github/actions/fetch-history
- name: Check whether this commit already passed before a title or body edit
id: edit
uses: ./.github/actions/edit-already-passed