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 Empty Cache save when the path is github workspace directory #1132

Merged
merged 8 commits into from
Jul 26, 2022

Conversation

lvpx
Copy link
Contributor

@lvpx lvpx commented Jul 13, 2022

This PR fixes the #833 issue in actions/cache.

Issue Summary: Cache being saved is empty in case of path being current directory or github.workspace. So github.workspace directory can never get cached.

Root cause: The resolvePaths function returns empty since the relative path of the path provided in cache's path param is calculated against the workspace directory itself.

Resolution: We manually add '.' to paths list since the list will be empty in the above scenario.

Feedback is welcome regarding the implementation and possible alternatives. 👀

@lvpx lvpx requested a review from aparna-ravindra July 13, 2022 13:44
@lvpx lvpx requested a review from a team as a code owner July 13, 2022 13:44
@lvpx lvpx changed the title Pdotl empty cache bugfix Fix Empty Cache save when the path is github workspace directory Jul 13, 2022
@aparna-ravindra
Copy link
Contributor

Please check the failing test cases?

Copy link
Contributor

@tiwarishub tiwarishub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. If you have time, let's also create a PR audit fix

@lvpx lvpx merged commit 74ff60c into main Jul 26, 2022
@lvpx lvpx deleted the pdotl-empty-cache-bugfix branch July 26, 2022 09:04
@lvpx
Copy link
Contributor Author

lvpx commented Jul 26, 2022

I'll create a separate PR for npm audit fix. 👍

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

Successfully merging this pull request may close these issues.

3 participants