Skip to content

Commit 6aa1188

Browse files
committed
fix(ci): Use download path
use env var to prevent interpolation (and script injection) Downloading to /tmp is not secure, it will be used on nexts action upgrade. Relate-to: ishworkh/container-image-artifact-download#8 Signed-off-by: Philippe Coval <[email protected]>
1 parent b911be9 commit 6aa1188

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,15 @@ jobs:
3535
workflow_run_id: ${{ github.event.workflow_run.id }}
3636
- name: Check and remove downloaded artifact
3737
# yamllint disable rule:line-length
38+
env:
39+
file: ${{ steps.image.outputs.download_path }}
3840
run: |
3941
set -xe
40-
file="/tmp/action_image_artifact_${{ github.event.repository.name }}_latest/${{ github.event.repository.name }}_latest"
4142
echo "Info for comparing to build artifacts"
42-
sha256sum "${file}"
43-
tar -xOf "${file}" manifest.json | jq
43+
sha256sum "${{env.file}}"
44+
tar -xOf "${{env.file}}" manifest.json | jq
4445
echo "TODO: https://github.com/ishworkh/container-image-artifact-download/issues/7#issuecomment-2904751460"
45-
rm -rfv "${file}"
46+
rm -rfv "${{env.file}}"
4647
echo "TODO: https://docs.docker.com/engine/security/trust/"
4748
# yamllint enable rule:line-length
4849
# yamllint disable-line rule:line-length

0 commit comments

Comments
 (0)