@@ -68,13 +68,13 @@ inputs:
6868 required : false
6969 default : ' true'
7070 print-hash : # Canonical alias for `print_hash`
71- description : Show hash values of files to be uploaded
71+ description : Show hash values of uploaded files
7272 required : false
7373 # default: 'false' # TODO: uncomment once alias removed
7474 print_hash : # DEPRECATED ALIAS; TODO: Remove in v3+
7575 description : >-
7676 [DEPRECATED]
77- Show hash values of files to be uploaded
77+ Show hash values of uploaded files
7878 deprecationMessage : >-
7979 The inputs have been normalized to use kebab-case.
8080 Use `print-hash` instead.
@@ -86,6 +86,9 @@ inputs:
8686 Only works with PyPI and TestPyPI via Trusted Publishing.
8787 required : false
8888 default : ' true'
89+ outputs :
90+ hashes :
91+ description : Hash values of uploaded files
8992branding :
9093 color : yellow
9194 icon : upload-cloud
@@ -154,6 +157,7 @@ runs:
154157 }}
155158 shell : bash
156159 - name : Run Docker container
160+ id : rundocker
157161 # The generated trampoline action must exist in the allowlisted
158162 # runner-defined working directory so it can be referenced by the
159163 # relative path starting with `./`.
@@ -174,5 +178,22 @@ runs:
174178 verify-metadata : ${{ inputs.verify-metadata || inputs.verify_metadata }}
175179 skip-existing : ${{ inputs.skip-existing || inputs.skip_existing }}
176180 verbose : ${{ inputs.verbose }}
177- print-hash : ${{ inputs.print-hash || inputs.print_hash }}
178181 attestations : ${{ inputs.attestations }}
182+ - name : Print hashes
183+ if : inputs.print-hash || inputs.print_hash
184+ run : |
185+ echo -n ${{ steps.rundocker.outputs.hashes }} | mapfile -d '' HASHES
186+ echo Showing hash values of uploaded files:
187+ for HASH in "${HASHES[@]}" ; do
188+ IFS=":" read -r SHA256 MD5 BLAKE2_256 FILE_OBJECT
189+ echo $FILE_OBJECT
190+ echo
191+ echo SHA256: $SHA256
192+ echo MD5: $MD5
193+ echo BLAKE2-256: $BLAKE_256
194+ echo
195+ done
196+ shell : bash
197+ - name : Output hashes
198+ run : echo "hashes=${{ steps.rundocker.outputs.hashes }}"
199+ shell : bash
0 commit comments