Skip to content

Commit d8fde07

Browse files
authored
Merge pull request #334 from openscript/330-reading-git-dosent-work-from-copied-content
sparse checkout content from master
2 parents 0c73244 + ce5c4da commit d8fde07

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

.changeset/hot-llamas-approve.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"r.obin.ch": patch
3+
---
4+
5+
Sparse checkout master content instead copy

.devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
"streetsidesoftware.code-spell-checker",
1010
"streetsidesoftware.code-spell-checker-german",
1111
"esbenp.prettier-vscode",
12-
"eamodio.gitlens",
1312
"mgmcdermott.vscode-language-babel",
1413
"dbaeumer.vscode-eslint",
1514
"eliostruyf.vscode-front-matter",
1615
"unifiedjs.vscode-mdx",
17-
"github.vscode-github-actions"
16+
"github.vscode-github-actions",
17+
"GitHub.vscode-pull-request-github"
1818
]
1919
}
2020
},

.github/workflows/cd-deploy.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@ jobs:
3737
ref: master
3838
path: master-content
3939

40-
- name: Copy content from master
40+
- name: Setup sparse checkout for content from master
4141
run: |
42-
rm -rf ${{ env.BUILD_PATH }}/src/content
43-
cp -r master-content/src/content/ ${{ env.BUILD_PATH }}/src/
42+
git -C ${{ env.BUILD_PATH }} sparse-checkout init --cone
43+
git -C ${{ env.BUILD_PATH }} sparse-checkout set src/content
44+
git -C ${{ env.BUILD_PATH }} fetch origin master
45+
git -C ${{ env.BUILD_PATH }} checkout origin/master -- src/content
4446
4547
- name: Setup pnpm
4648
uses: pnpm/action-setup@v4

0 commit comments

Comments
 (0)