Skip to content

Commit

Permalink
d
Browse files Browse the repository at this point in the history
  • Loading branch information
robinjhuang committed Jun 27, 2024
1 parent e0467bd commit 1c50515
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,20 @@ runs:
if: ${{ inputs.os == 'windows' }}
id: generate_hash_windows
run: |
$jsonString = '{"v1-5-pruned-emaonly.ckpt": {"url": "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt", "directory": "checkpoints"}}'
# Escape the JSON string from the GitHub Actions input
$jsonString = "${{ inputs.models-json }}"
$jsonString = $jsonString -replace '"', '\"'
# Convert the JSON string to bytes
$bytes = [System.Text.Encoding]::UTF8.GetBytes($jsonString)
# Create a memory stream from the bytes
$stream = [System.IO.MemoryStream]::new($bytes)
# Calculate the SHA256 hash of the data in the memory stream
$hash = (Get-FileHash -Algorithm SHA256 -InputStream $stream).Hash
# Output the hash to the GitHub Actions environment
echo "hash=$hash" >> $GITHUB_OUTPUT
shell: powershell

Expand Down

0 comments on commit 1c50515

Please sign in to comment.