Skip to content

Commit c7e3e2f

Browse files
committed
fix(ci): Update action to use safer download dir
Use env var to prevent interpolation (and script injection) Downloading to /tmp is not secure, it will be used on nexts action upgrade. Origin: #122 Relate-to: ishworkh/container-image-artifact-download#7 (comment) Relate-to: Z-Wave-Alliance/OSWG#48 (comment) Relate-to: #67 Relate-to: #100 Signed-off-by: Philippe Coval <[email protected]>
1 parent 1136b23 commit c7e3e2f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/workflows/test.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,23 @@ jobs:
2727
- name: Download image
2828
id: image
2929
# yamllint disable-line rule:line-length
30-
uses: ishworkh/container-image-artifact-download@ccb3671db007622e886a2d7037eb62b119d5ffaf # v2.0.0
30+
uses: ishworkh/container-image-artifact-download@d5e9b6d62ef3f9762f6553c8178c2d925acc0409 # v2.1.0
3131
with:
3232
image: "${{ env.project-name }}:latest"
3333
workflow: "build"
3434
token: ${{ secrets.GH_SL_ACCESS_TOKEN }}
3535
workflow_run_id: ${{ github.event.workflow_run.id }}
36+
download_tmp_dir: ${{ runner.temp }}
3637
- name: Check and remove downloaded artifact
3738
# yamllint disable rule:line-length
39+
env:
40+
file: ${{ steps.image.outputs.download_path }}
3841
run: |
3942
set -xe
40-
file="/tmp/action_image_artifact_${{ github.event.repository.name }}_latest/${{ github.event.repository.name }}_latest"
4143
echo "Info for comparing to build artifacts"
42-
sha256sum "${file}"
43-
tar -xOf "${file}" manifest.json | jq
44-
echo "TODO: https://github.com/ishworkh/container-image-artifact-download/issues/7#issuecomment-2904751460"
45-
rm -rfv "${file}"
44+
sha256sum "${{env.file}}"
45+
tar -xOf "${{env.file}}" manifest.json | jq
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)