Skip to content

Commit 26748f1

Browse files
authored
build: add fetch depth when using actions/checkout (googleapis#12014)
Fixes googleapis#12013 🦕
1 parent c28986d commit 26748f1

7 files changed

Lines changed: 48 additions & 0 deletions

File tree

.github/workflows/configure_release_please.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ jobs:
3636
if: ${{github.repository == 'googleapis/google-cloud-python'}}
3737
steps:
3838
- uses: actions/checkout@v4
39+
# Use a fetch-depth of 2
40+
# See https://github.com/googleapis/google-cloud-python/issues/12013
41+
# and https://github.com/actions/checkout#checkout-head.
42+
with:
43+
fetch-depth: 2
3944
- name: Set up Python 3.11
4045
uses: actions/setup-python@v4
4146
with:

.github/workflows/docs.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ jobs:
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v4
16+
# Use a fetch-depth of 2 to avoid error `fatal: origin/main...HEAD: no merge base`
17+
# See https://github.com/googleapis/google-cloud-python/issues/12013
18+
# and https://github.com/actions/checkout#checkout-head.
19+
with:
20+
fetch-depth: 2
1621
- name: Setup Python
1722
uses: actions/setup-python@v4
1823
with:
@@ -33,6 +38,11 @@ jobs:
3338
steps:
3439
- name: Checkout
3540
uses: actions/checkout@v4
41+
# Use a fetch-depth of 2 to avoid error `fatal: origin/main...HEAD: no merge base`
42+
# See https://github.com/googleapis/google-cloud-python/issues/12013
43+
# and https://github.com/actions/checkout#checkout-head.
44+
with:
45+
fetch-depth: 2
3646
- name: Setup Python
3747
uses: actions/setup-python@v4
3848
with:

.github/workflows/lint.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ jobs:
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v4
16+
# Use a fetch-depth of 2 to avoid error `fatal: origin/main...HEAD: no merge base`
17+
# See https://github.com/googleapis/google-cloud-python/issues/12013
18+
# and https://github.com/actions/checkout#checkout-head.
19+
with:
20+
fetch-depth: 2
1621
- name: Setup Python
1722
uses: actions/setup-python@v4
1823
with:

.github/workflows/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ jobs:
3737
id: date
3838
run: echo "::set-output name=current_date::$(date +'%Y-%m-%d')"
3939
- uses: actions/checkout@v4
40+
# Use a fetch-depth of 2
41+
# See https://github.com/googleapis/google-cloud-python/issues/12013
42+
# and https://github.com/actions/checkout#checkout-head.
43+
with:
44+
fetch-depth: 2
4045
- name: Set up Python 3.10
4146
uses: actions/setup-python@v4
4247
with:

.github/workflows/scripts.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ jobs:
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v4
16+
# Use a fetch-depth of 2
17+
# See https://github.com/googleapis/google-cloud-python/issues/12013
18+
# and https://github.com/actions/checkout#checkout-head.
19+
with:
20+
fetch-depth: 2
1621
- name: Setup Python
1722
uses: actions/setup-python@v4
1823
with:

.github/workflows/unittest.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ jobs:
1616
steps:
1717
- name: Checkout
1818
uses: actions/checkout@v4
19+
# Use a fetch-depth of 2 to avoid error `fatal: origin/main...HEAD: no merge base`
20+
# See https://github.com/googleapis/google-cloud-python/issues/12013
21+
# and https://github.com/actions/checkout#checkout-head.
1922
with:
2023
fetch-depth: 2
2124
- name: Setup Python
@@ -47,6 +50,11 @@ jobs:
4750
steps:
4851
- name: Checkout
4952
uses: actions/checkout@v4
53+
# Use a fetch-depth of 2 to avoid error `fatal: origin/main...HEAD: no merge base`
54+
# See https://github.com/googleapis/google-cloud-python/issues/12013
55+
# and https://github.com/actions/checkout#checkout-head.
56+
with:
57+
fetch-depth: 2
5058
- name: Setup Python
5159
uses: actions/setup-python@v4
5260
with:
@@ -70,6 +78,11 @@ jobs:
7078
steps:
7179
- name: Checkout
7280
uses: actions/checkout@v4
81+
# Use a fetch-depth of 2 to avoid error `fatal: origin/main...HEAD: no merge base`
82+
# See https://github.com/googleapis/google-cloud-python/issues/12013
83+
# and https://github.com/actions/checkout#checkout-head.
84+
with:
85+
fetch-depth: 2
7386
- name: Setup Python
7487
uses: actions/setup-python@v4
7588
with:

.github/workflows/updatechangelog.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ jobs:
3434
if: ${{github.repository == 'googleapis/google-cloud-python'}}
3535
steps:
3636
- uses: actions/checkout@v4
37+
# Use a fetch-depth of 2
38+
# See https://github.com/googleapis/google-cloud-python/issues/12013
39+
# and https://github.com/actions/checkout#checkout-head.
40+
with:
41+
fetch-depth: 2
3742
- name: Run bash script to update CHANGELOG.md in the root directory
3843
run: ./scripts/updatechangelog.sh
3944
- uses: googleapis/code-suggester@v4

0 commit comments

Comments
 (0)