mirror of
				https://github.com/actions/cache.git
				synced 2025-10-31 20:08:36 +08:00 
			
		
		
		
	Merge branch 'main' into chore/apply-reusable-workflows
This commit is contained in:
		
						commit
						faaf1061c0
					
				|  | @ -197,7 +197,7 @@ Additionally, you can use arbitrary command output in a cache key, such as a dat | ||||||
|   - name: Get Date |   - name: Get Date | ||||||
|     id: get-date |     id: get-date | ||||||
|     run: | |     run: | | ||||||
|       echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")" |       echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT | ||||||
|     shell: bash |     shell: bash | ||||||
| 
 | 
 | ||||||
|   - uses: actions/cache@v3 |   - uses: actions/cache@v3 | ||||||
|  |  | ||||||
|  | @ -358,7 +358,7 @@ The yarn cache directory will depend on your operating system and version of `ya | ||||||
| ```yaml | ```yaml | ||||||
| - name: Get yarn cache directory path | - name: Get yarn cache directory path | ||||||
|   id: yarn-cache-dir-path |   id: yarn-cache-dir-path | ||||||
|   run: echo "::set-output name=dir::$(yarn cache dir)" |   run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | ||||||
| 
 | 
 | ||||||
| - uses: actions/cache@v3 | - uses: actions/cache@v3 | ||||||
|   id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) |   id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||||||
|  | @ -376,7 +376,7 @@ The yarn 2 cache directory will depend on your config. See https://yarnpkg.com/c | ||||||
| ```yaml | ```yaml | ||||||
| - name: Get yarn cache directory path | - name: Get yarn cache directory path | ||||||
|   id: yarn-cache-dir-path |   id: yarn-cache-dir-path | ||||||
|   run: echo "::set-output name=dir::$(yarn config get cacheFolder)" |   run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT | ||||||
| 
 | 
 | ||||||
| - uses: actions/cache@v3 | - uses: actions/cache@v3 | ||||||
|   id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) |   id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||||||
|  | @ -421,7 +421,7 @@ Esy allows you to export built dependencies and import pre-built dependencies. | ||||||
| - name: Get Composer Cache Directory | - name: Get Composer Cache Directory | ||||||
|   id: composer-cache |   id: composer-cache | ||||||
|   run: | |   run: | | ||||||
|     echo "::set-output name=dir::$(composer config cache-files-dir)" |     echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||||||
| - uses: actions/cache@v3 | - uses: actions/cache@v3 | ||||||
|   with: |   with: | ||||||
|     path: ${{ steps.composer-cache.outputs.dir }} |     path: ${{ steps.composer-cache.outputs.dir }} | ||||||
|  | @ -513,7 +513,7 @@ jobs: | ||||||
| - name: Get pip cache dir | - name: Get pip cache dir | ||||||
|   id: pip-cache |   id: pip-cache | ||||||
|   run: | |   run: | | ||||||
|     echo "::set-output name=dir::$(pip cache dir)" |     echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT | ||||||
| 
 | 
 | ||||||
| - name: pip cache | - name: pip cache | ||||||
|   uses: actions/cache@v3 |   uses: actions/cache@v3 | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| # Restore action | # Restore action | ||||||
| 
 | 
 | ||||||
| The restore action, as the name suggest, restores a cache. It acts similar to the`cache` action except that it doesn't have a post step to save the cache. This action can provide you a granular control to only restore a cache without having to necessarily save it.  It accepts the same set of inputs as the `cache` action. | The restore action, as the name suggest, restores a cache. It acts similar to the `cache` action except that it doesn't have a post step to save the cache. This action can provide you a granular control to only restore a cache without having to necessarily save it.  It accepts the same set of inputs as the `cache` action. | ||||||
| 
 | 
 | ||||||
| ## Inputs | ## Inputs | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -54,7 +54,7 @@ Case 1: Where an user would want to reuse the key as it is | ||||||
| ```yaml | ```yaml | ||||||
| uses: actions/cache/save@v3 | uses: actions/cache/save@v3 | ||||||
| with: | with: | ||||||
|     key: ${{ steps.restore-cache.outputs.key }} |     key: ${{ steps.restore-cache.outputs.cache-primary-key }} | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| Case 2: Where the user would want to re-evaluate the key | Case 2: Where the user would want to re-evaluate the key | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Shubham Tiwari
						Shubham Tiwari