Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Cache Key Calculation in Phive Install GitHub Action #197

Merged
merged 1 commit into from
Jun 7, 2024
Merged

Fix Cache Key Calculation in Phive Install GitHub Action #197

merged 1 commit into from
Jun 7, 2024

Conversation

lotyp
Copy link
Contributor

@lotyp lotyp commented Jun 7, 2024

Description

I've noticed a bug in the Phive install action where the cache key is incorrectly calculated. Instead of generating a hash from phars.xml, the function name is printed as a string, leading to cache failures when phars.xml is updated in a single pull request.

Current Output:

Screenshot 2024-06-07 at 21 44 48

Fix:
I updated the cache key calculation from:

key: "phive-hashFiles('**/phars.xml')"

to:

key: phive-${{ hashFiles('**/phars.xml') }}

After fix is applied:

Screenshot 2024-06-07 at 22 51 40

This should ensure the correct hash is generated and the cache is restored properly.

I encountered a similar issue in my wayofdev/gh-actions repository, which also uses Phive install inspired by your repository.

How to check cache keys?:

https://github.com/cli/cli can be used to check all cache keys of repository:

gh cache list

@localheinz localheinz self-assigned this Jun 7, 2024
@localheinz localheinz merged commit bc55f37 into ergebnis:main Jun 7, 2024
2 checks passed
@localheinz
Copy link
Member

Thank you, @lotyp!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants