taojintianxia commented on issue #21400:
URL: 
https://github.com/apache/shardingsphere/issues/21400#issuecomment-1272963458

   **Usage**
   The cache action first searches for cache hits for key and restore-keys in 
the branch containing the workflow run. If there are no hits in the current 
branch, the cache action searches for key and restore-keys in the parent branch 
and upstream branches.
   
   restore-keys allows you to specify a list of alternate restore keys to use 
when there is a cache miss on key. You can create multiple restore keys ordered 
from the most specific to least specific. The cache action searches the 
restore-keys in sequential order. When a key doesn't match directly, the action 
searches for keys prefixed with the restore key. If there are multiple partial 
matches for a restore key, the action returns the most recently created cache.
   
   #### Example using multiple restore keys
   ```
   restore-keys: |
     npm-feature-${{ hashFiles('package-lock.json') }}
     npm-feature-
     npm-
   ```
   
   The runner evaluates the expressions, which resolve to these restore-keys:
   
   ```
   restore-keys: |
     npm-feature-d5ea0750
     npm-feature-
     npm-
   ```
   
   The restore key npm-feature- matches any key that starts with the string 
npm-feature-. For example, both of the keys npm-feature-fd3052de and 
npm-feature-a9b253ff match the restore key. The cache with the most recent 
creation date would be used. The keys in this example are searched in the 
following order:
   
   1. npm-feature-d5ea0750 matches a specific hash.
   2. npm-feature- matches cache keys prefixed with npm-feature-.
   3. npm- matches any keys prefixed with npm-.
   
   #### Example of search priority
   1. Key npm-feature-d5ea0750 in the feature branch
   2. Key npm-feature- in the feature branch
   3. Key npm- in the feature branch
   4. Key npm-feature-d5ea0750 in the main branch
   5. Key npm-feature- in the main branch
   6. Key npm- in the main branch


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to