Skip to content

Commit

Permalink
Fix wrong version used for cache key
Browse files Browse the repository at this point in the history
As the hash is always included, this has only cosmetic impact
  • Loading branch information
mosteo committed Jan 30, 2024
1 parent 1ea72ad commit 56455b5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,19 @@ runs:
steps:

- name: Identify hash from which alr was built
# Identifies the version and hash to be used for the cache key
id: find-hash
shell: bash
run: |
if [[ "${{ inputs.branch }}" != "" ]]; then
echo "hash=$(git ls-remote --heads https://github.com/alire-project/alire ${{ inputs.branch }} | cut -f1)" >> $GITHUB_OUTPUT
echo "version=${{ inputs.branch }}" >> $GITHUB_OUTPUT
elif [[ "${{ inputs.version }}" != "nightly" ]]; then
echo "hash=$(git ls-remote --tags https://github.com/alire-project/alire v${{ inputs.version }} | cut -f1)" >> $GITHUB_OUTPUT
echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
else
echo "hash=$(git ls-remote --tags https://github.com/alire-project/alire ${{ inputs.version }} | cut -f1)" >> $GITHUB_OUTPUT
echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
fi
- name: Reuse cached installation
Expand All @@ -55,7 +59,7 @@ runs:
~/.cache/alire
~/.config/alire
./alire_install
key: alr[${{ inputs.version }}][${{ inputs.toolchain }}][${{ runner.os }}][${{ steps.find-hash.outputs.hash }}]
key: alr[${{ steps.find-hash.outputs.version }}][${{ inputs.toolchain }}][${{ runner.os }}][${{ steps.find-hash.outputs.hash }}]
# .cache contains msys64 install on Windows
# .config contains the toolchain at the default location, besides index config
# ./alire_install contains alr itself
Expand Down

0 comments on commit 56455b5

Please sign in to comment.