You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue #1789: chore(repo): add a conditional git-lfs checkout in github actions when needed (#2516)
```
[4/6] STEP 13/33: RUN mkdir -p /opt/app-root/extensions-temp && code-server --install-extension /opt/app-root/bin/utils/ms-python.python-2025.2.0.vsix --extensions-dir /opt/app-root/extensions-temp && code-server --install-extension /opt/app-root/bin/utils/ms-toolsai.jupyter-2025.2.0.vsix --extensions-dir /opt/app-root/extensions-temp
[2025-09-19T08:59:44.572Z] info Wrote default config file to /opt/app-root/src/.config/code-server/config.yaml
Installing extensions...
Error: End of central directory record signature not found. Either not a zip file, or file is truncated.
at k8 (file:///usr/lib/code-server/lib/vscode/out/server-main.js:48:2239)
at file:///usr/lib/code-server/lib/vscode/out/server-main.js:48:3567
at /usr/lib/code-server/lib/vscode/node_modules/yauzl/index.js:40:7
at /usr/lib/code-server/lib/vscode/node_modules/yauzl/index.js:190:5
at /usr/lib/code-server/lib/vscode/node_modules/yauzl/index.js:712:5
at /usr/lib/code-server/lib/vscode/node_modules/yauzl/fd-slicer.js:33:7
at FSReqCallback.wrapper [as oncomplete] (node:fs:671:5) {
code: 'Extract',
name: 'Extract'
}
Failed Installing Extensions: file:///opt/app-root/bin/utils/ms-python.python-2025.2.0.vsix
```
I'll locate the workflow template and the code paths that determine when a codeserver image is being built, then update the checkout step to use LFS conditionally.
[2 tools called]
I'll open the workflow template to see the checkout step and the job matrix to identify how to detect codeserver builds, then edit it to set checkout lfs conditionally.
[1 tool called]
I’m going to update the workflow template to set the checkout action’s LFS option conditionally: enabled when `inputs.target` contains `codeserver`, disabled otherwise, for both the normal and pull_request_target checkout steps.
[2 tools called]
- I found the workflow template and updated the checkout steps to toggle LFS based on whether we’re building a codeserver image.
Changes made in `.github/workflows/build-notebooks-TEMPLATE.yaml`:
- For both checkout steps, added `with.lfs: ${{ contains(inputs.target, 'codeserver') }}`.
- This sets LFS to true when `inputs.target` contains `codeserver`, and false otherwise, including the `pull_request_target` case.
Example of the updated blocks:
```12:16:.github/workflows/build-notebooks-TEMPLATE.yaml
- uses: actions/checkout@v5
if: ${{ fromJson(inputs.github).event_name != 'pull_request_target' }}
with:
lfs: ${{ contains(inputs.target, 'codeserver') }}
```
```66:71:.github/workflows/build-notebooks-TEMPLATE.yaml
- uses: actions/checkout@v5
if: ${{ fromJson(inputs.github).event_name == 'pull_request_target' }}
with:
ref: "refs/pull/${{ fromJson(inputs.github).event.number }}/merge"
lfs: ${{ contains(inputs.target, 'codeserver') }}
```
Summary:
- Conditional LFS checkout implemented in the workflow template for codeserver builds; no lints reported.
0 commit comments