Skip to content

Commit 2a1fd72

Browse files
committed
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.
1 parent 8744396 commit 2a1fd72

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

.github/workflows/build-notebooks-TEMPLATE.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,15 @@ jobs:
6161
6262
- uses: actions/checkout@v5
6363
if: ${{ fromJson(inputs.github).event_name != 'pull_request_target' }}
64+
with:
65+
lfs: ${{ contains(inputs.target, 'codeserver') }}
6466
# we need to checkout the pr branch, not pr target (the default for pull_request_target)
6567
# user access check is done in calling workflow
6668
- uses: actions/checkout@v5
6769
if: ${{ fromJson(inputs.github).event_name == 'pull_request_target' }}
6870
with:
6971
ref: "refs/pull/${{ fromJson(inputs.github).event.number }}/merge"
72+
lfs: ${{ contains(inputs.target, 'codeserver') }}
7073

7174
# https://github.com/docker/setup-qemu-action?tab=readme-ov-file#about
7275
# https://www.itix.fr/blog/qemu-user-static-with-podman/

0 commit comments

Comments
 (0)