Skip to content

Commit

Permalink
Generate model hash.
Browse files Browse the repository at this point in the history
  • Loading branch information
robinjhuang committed Jun 26, 2024
1 parent 262110d commit e93795a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,17 @@ runs:
cd ${{ github.action_path }}
pip3 install -r requirements.txt
- name: Generate hash from models-json
id: generate_hash
run: |
echo "::set-output name=hash::$(echo '${{ inputs.models-json }}' | sha256sum | cut -d ' ' -f1)"
shell: bash

- name: Cache models
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/models
key: ${{ runner.os }}-models-${{ hashFiles(format('{0}', inputs.models-json)) }}
key: ${{ runner.os }}-models-${{ steps.generate_hash.outputs.hash }}

- name: '[Unix] Download models'
if: ${{ inputs.os != 'windows' }}
Expand Down

0 comments on commit e93795a

Please sign in to comment.