Skip to content

Commit 7d392b1

Browse files
committed
Temporarily downgrade Git to prevent fatal error
1 parent c44dca0 commit 7d392b1

3 files changed

Lines changed: 27 additions & 0 deletions

File tree

.github/workflows/reusable-check-html-ids.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ jobs:
2020
with:
2121
persist-credentials: false
2222
ref: ${{ github.event.pull_request.head.sha }}
23+
- name: 'Downgrade Git'
24+
# Temporarily downgrade to 2.43 until 2.55 is in the runner image,
25+
# to avoid "fatal: shallow file has changed since we read it" bug.
26+
# See https://github.com/python/cpython/issues/151365.
27+
run: |
28+
version=$(apt-cache madison git | awk '/noble-updates/ {print $3; exit}')
29+
sudo apt-get install -y --allow-downgrades "git=${version}" "git-man=${version}"
30+
git --version
2331
- name: 'Find merge base'
2432
id: merge-base
2533
run: |

.github/workflows/reusable-context.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,16 @@ jobs:
9090
|| ''
9191
}}
9292
93+
- name: 'Downgrade Git'
94+
# Temporarily downgrade to 2.43 until 2.55 is in the runner image,
95+
# to avoid "fatal: shallow file has changed since we read it" bug.
96+
# See https://github.com/python/cpython/issues/151365.
97+
if: github.event_name == 'pull_request'
98+
run: |
99+
version=$(apt-cache madison git | awk '/noble-updates/ {print $3; exit}')
100+
sudo apt-get install -y --allow-downgrades "git=${version}" "git-man=${version}"
101+
git --version
102+
93103
# Adapted from https://github.com/actions/checkout/issues/520#issuecomment-1167205721
94104
- name: Fetch commits to get branch diff
95105
if: github.event_name == 'pull_request'

.github/workflows/reusable-docs.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@ jobs:
4747
&& github.event.pull_request.head.sha
4848
|| ''
4949
}}
50+
- name: 'Downgrade Git'
51+
# Temporarily downgrade to 2.43 until 2.55 is in the runner image,
52+
# to avoid "fatal: shallow file has changed since we read it" bug.
53+
# See https://github.com/python/cpython/issues/151365.
54+
if: github.event_name == 'pull_request'
55+
run: |
56+
version=$(apt-cache madison git | awk '/noble-updates/ {print $3; exit}')
57+
sudo apt-get install -y --allow-downgrades "git=${version}" "git-man=${version}"
58+
git --version
5059
# Adapted from https://github.com/actions/checkout/issues/520#issuecomment-1167205721
5160
- name: 'Fetch commits to get branch diff'
5261
if: github.event_name == 'pull_request'

0 commit comments

Comments
 (0)