mirror of
https://github.com/awalsh128/cache-apt-pkgs-action.git
synced 2024-11-09 19:58:46 +00:00
Hash on content and not on file state.
This commit is contained in:
parent
08d1b85370
commit
9c18c92e77
|
@ -30,7 +30,10 @@ runs:
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Create Cache Key
|
- name: Create Cache Key
|
||||||
run: echo ${{ inputs.packages }} "cache-apt-pkgs-version:${{ inputs.version }}" | sed 's/[\s,]+/\n/g' | sort > package_list.txt
|
run: |
|
||||||
|
normalized_list=$(${{ inputs.packages }} | sed 's/[\s,]+/ /g' | sort)
|
||||||
|
value=$(echo $normalized_list @ ${{ inputs.version }})
|
||||||
|
echo "CACHE_KEY=$(echo value | md5sum | /bin/cut -f1 -d' ')" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Load Package Cache
|
- name: Load Package Cache
|
||||||
|
@ -38,7 +41,7 @@ runs:
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: ~/cache-apt-pkgs
|
path: ~/cache-apt-pkgs
|
||||||
key: cache-apt-pkgs_${{ hashFiles('package_list.txt') }}
|
key: cache-apt-pkgs_${{ env.CACHE_KEY }}
|
||||||
|
|
||||||
- name: Load Packages
|
- name: Load Packages
|
||||||
run: |
|
run: |
|
||||||
|
|
Loading…
Reference in a new issue