Skip to content

Commit 2a4074b

Browse files
committed
fix(sandbox): harden image packaging integrity checks
1 parent 09b623f commit 2a4074b

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

.github/actions/push-sandbox/action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ runs:
7777
--image google/gemini-cli-sandbox:${{ steps.image_tag.outputs.FINAL_TAG }} \
7878
--output-file final_image_uri.txt
7979
echo "uri=$(cat final_image_uri.txt)" >> $GITHUB_OUTPUT
80+
- name: 'verify'
81+
shell: 'bash'
82+
run: |-
83+
docker run --rm --entrypoint sh "${{ steps.docker_build.outputs.uri }}" -lc '
84+
set -e
85+
node -e "const fs=require(\"node:fs\"); JSON.parse(fs.readFileSync(\"/usr/local/share/npm-global/lib/node_modules/@google/gemini-cli/package.json\",\"utf8\")); JSON.parse(fs.readFileSync(\"/usr/local/share/npm-global/lib/node_modules/@google/gemini-cli-core/package.json\",\"utf8\"));"
86+
/usr/local/share/npm-global/bin/gemini --version >/dev/null
87+
'
8088
- name: 'publish'
8189
shell: 'bash'
8290
if: "${{ inputs.dry-run != 'true' }}"

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ USER node
4242
# install gemini-cli and clean up
4343
COPY packages/cli/dist/google-gemini-cli-*.tgz /tmp/gemini-cli.tgz
4444
COPY packages/core/dist/google-gemini-cli-core-*.tgz /tmp/gemini-core.tgz
45-
RUN npm install -g /tmp/gemini-cli.tgz /tmp/gemini-core.tgz \
45+
RUN npm install -g /tmp/gemini-core.tgz \
46+
&& npm install -g /tmp/gemini-cli.tgz \
47+
&& node -e "const fs=require('node:fs'); JSON.parse(fs.readFileSync('/usr/local/share/npm-global/lib/node_modules/@google/gemini-cli/package.json','utf8')); JSON.parse(fs.readFileSync('/usr/local/share/npm-global/lib/node_modules/@google/gemini-cli-core/package.json','utf8'));" \
48+
&& gemini --version > /dev/null \
4649
&& npm cache clean --force \
4750
&& rm -f /tmp/gemini-{cli,core}.tgz
4851

0 commit comments

Comments
 (0)