actions / cache

Cache dependencies and build outputs in GitHub Actions
MIT License
4.36k stars 1.16k forks source link

Avoid re-evaluation of the key input in restore implementation #1374

Open itchyny opened 2 months ago

itchyny commented 2 months ago

Description

This PR fixes the re-evaluation of the key input for setting the cache-hit output in the restore implementation.

Motivation and Context

I noticed that the restore implementation re-evaluates the key input on setting the cache-hit output. This does not cause any real issue, the change just refactors the code.

How Has This Been Tested?

I have run the unit tests restoreImpl.test.ts which covers the code I changed.

Screenshots (if appropriate):

Types of changes

Checklist: