fix: let artifact_upload fail if a bash command errors (#3154)

This commit is contained in:
miampf 2024-06-07 13:37:06 +02:00 committed by GitHub
parent 2c03a16a68
commit 94cf85c65a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -36,6 +36,7 @@ runs:
- name: Create archive - name: Create archive
shell: bash shell: bash
run: | run: |
set -euo pipefail
shopt -s extglob shopt -s extglob
paths="${{ inputs.path }}" paths="${{ inputs.path }}"
paths=${paths%$'\n'} # Remove trailing newline paths=${paths%$'\n'} # Remove trailing newline
@ -61,9 +62,9 @@ runs:
do do
if compgen -G "${target}" > /dev/null if compgen -G "${target}" > /dev/null
then then
pushd "$(dirname "${target}")" || exit 1 pushd "$(dirname "${target}")"
7zz a -p'${{ inputs.encryptionSecret }}' -bso0 -bsp0 -t7z -ms=on -mhe=on "${{ steps.tempdir.outputs.directory }}/archive.7z" "$(basename "${target}")" 7zz a -p'${{ inputs.encryptionSecret }}' -bso0 -bsp0 -t7z -ms=on -mhe=on "${{ steps.tempdir.outputs.directory }}/archive.7z" "$(basename "${target}")"
popd || exit 1 popd
fi fi
done done