add action outputs
This commit is contained in:
		
							parent
							
								
									51fa6f716f
								
							
						
					
					
						commit
						014b12e7fb
					
				
					 1 changed files with 11 additions and 4 deletions
				
			
		|  | @ -2,11 +2,13 @@ | |||
| 
 | ||||
| dir="$(dirname "${INPUT_FILES}")" | ||||
| glob="$(basename "${INPUT_FILES}")" | ||||
| # Pass these through sort so we can have deterministic output indexing | ||||
| if [ "${glob}" = "**" ]; then | ||||
|   all_files="$(find "$dir" -type f)" | ||||
|   all_files="$(find "$dir" -type f |sort)" | ||||
| else | ||||
|   all_files="$(find "$dir" -maxdepth 1 -name "${glob}")" | ||||
|   all_files="$(find "$dir" -maxdepth 1 -name "${glob}" |sort)" | ||||
| fi | ||||
| i=0 | ||||
| while IFS=  read -r f; do | ||||
|   sign_dir="$(dirname "$f")" | ||||
|   sign_file="$(basename "$f")" | ||||
|  | @ -35,8 +37,13 @@ while IFS=  read -r f; do | |||
|     echo "Fetching key from ${INPUT_PUBLIC_KEY}" | ||||
|     curl -sLo /tmp/public_key "${INPUT_PUBLIC_KEY}" | ||||
|     ec=$?; if [ $ec -ne 0 ]; then exit $ec; fi | ||||
|     rekor upload --artifact "$f" --signature "${dest_sig}" --pki-format x509 --public-key /tmp/public_key | ||||
|     ec=$?; if [ $ec -ne 0 ]; then exit $ec; fi | ||||
|     output=$(rekor upload --artifact "$f" --signature "${dest_sig}" --pki-format x509 --public-key /tmp/public_key) | ||||
|     ec=$?; echo "$output"; if [ $ec -ne 0 ]; then exit $ec; fi | ||||
|     echo "INDEX_${i}=$(echo "$output"|cut -d, -f1|cut -d\  -f5)" >> "${GITHUB_OUTPUT}" | ||||
|     echo "URL_${i}=$(echo "$output"|cut -d: -f2-|cut -d\  -f2)" >> "${GITHUB_OUTPUT}" | ||||
|     echo "SOURCE_${i}=${f}" >> "${GITHUB_OUTPUT}" | ||||
|     echo "SIG_${i}=${dest_sig}" >> "${GITHUB_OUTPUT}" | ||||
|     i=$((i+1)) | ||||
|   fi | ||||
| done <<ALLFILES_INPUT | ||||
| $all_files | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue