mirror of
				https://github.com/actions/cache.git
				synced 2025-11-04 17:06:38 +07:00 
			
		
		
		
	Compare commits
	
		
			2 Commits
		
	
	
		
			phantsure/
			...
			bishal-pdM
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 619517aa29 | |||
| dc097e3bb9 | 
@ -317,7 +317,7 @@ After [deprecation](https://github.blog/changelog/2022-10-11-github-actions-depr
 | 
				
			|||||||
### Bash shell
 | 
					### Bash shell
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
- name: Get npm cache directory
 | 
					- name: Get npm cache directory
 | 
				
			||||||
  id: npm-cache
 | 
					  id: npm-cache-dir
 | 
				
			||||||
  shell: bash
 | 
					  shell: bash
 | 
				
			||||||
  run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
 | 
					  run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
@ -325,7 +325,7 @@ After [deprecation](https://github.blog/changelog/2022-10-11-github-actions-depr
 | 
				
			|||||||
### PWSH shell
 | 
					### PWSH shell
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
- name: Get npm cache directory
 | 
					- name: Get npm cache directory
 | 
				
			||||||
  id: npm-cache
 | 
					  id: npm-cache-dir
 | 
				
			||||||
  shell: pwsh
 | 
					  shell: pwsh
 | 
				
			||||||
  run: echo "dir=$(npm config get cache)" >> ${env:GITHUB_OUTPUT}
 | 
					  run: echo "dir=$(npm config get cache)" >> ${env:GITHUB_OUTPUT}
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
				
			|||||||
@ -14,7 +14,7 @@ A cache today is immutable and cannot be updated. But some use cases require the
 | 
				
			|||||||
          restore-keys: |
 | 
					          restore-keys: |
 | 
				
			||||||
            primes-${{ runner.os }}
 | 
					            primes-${{ runner.os }}
 | 
				
			||||||
  ```          
 | 
					  ```          
 | 
				
			||||||
  Please note that this will create a new cache on every run and hence will consume the cache [quota](#cache-limits).
 | 
					  Please note that this will create a new cache on every run and hence will consume the cache [quota](./README.md#cache-limits).
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
## Use cache across feature branches
 | 
					## Use cache across feature branches
 | 
				
			||||||
Reusing cache across feature branches is not allowed today to provide cache [isolation](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache). However if both feature branches are from the default branch, a good way to achieve this is to ensure that the default branch has a cache. This cache will then be consumable by both feature branches.
 | 
					Reusing cache across feature branches is not allowed today to provide cache [isolation](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache). However if both feature branches are from the default branch, a good way to achieve this is to ensure that the default branch has a cache. This cache will then be consumable by both feature branches.
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user