Skip to content

Commit 39c3c87

Browse files
samrobillardsamuel.robillard
andauthored
Update fetch-depth for template checkout (#189)
* fix: update fetch-depth for template checkout to ensure full history * Allow shallow metadata updates * Troubleshooting --------- Co-authored-by: samuel.robillard <samuel.robillard@workleap.com>
1 parent 40f7b1b commit 39c3c87

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/github-template-update-downstream.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105
- name: Checkout Template
106106
uses: actions/checkout@v5
107107
with:
108-
fetch-depth: 1
108+
fetch-depth: 0
109109
path: template
110110

111111
- name: Checkout Downstream
@@ -148,7 +148,7 @@ jobs:
148148
# Add and fetch the template remote
149149
git remote add template ../template
150150
Assert-ExitCode 'git remote add'
151-
git fetch --no-tags template
151+
git fetch --no-tags --update-shallow template
152152
Assert-ExitCode 'git fetch template'
153153
154154
$excludePattern = ":(exclude).github/workflows/${{ inputs.workflowFileName }}"
@@ -164,7 +164,7 @@ jobs:
164164
165165
# Build git restore arguments, using '--' so remaining tokens are treated as pathspecs
166166
$gitRestoreArgs = @(
167-
'--source=template/main'
167+
'--source=FETCH_HEAD'
168168
'--staged'
169169
'--worktree'
170170
'--'

0 commit comments

Comments
 (0)