mirror of
				https://github.com/Swatinem/rust-cache
				synced 2025-10-31 12:52:28 +00:00 
			
		
		
		
	
							parent
							
								
									2639a56bb8
								
							
						
					
					
						commit
						be44a3e6ff
					
				
					 3 changed files with 18 additions and 7 deletions
				
			
		|  | @ -21,6 +21,9 @@ sensible defaults. | |||
| : `key` | ||||
| An optional key that is added to the automatic cache key. | ||||
| 
 | ||||
| : `sharedKey` | ||||
| An additional key that is stable over multiple jobs. | ||||
| 
 | ||||
| : `working-directory` | ||||
| The working directory the action operates in, is case the cargo project is not | ||||
| located in the repo root. | ||||
|  |  | |||
|  | @ -5,6 +5,9 @@ inputs: | |||
|   key: | ||||
|     description: "An additional key for the cache" | ||||
|     required: false | ||||
|   sharedKey: | ||||
|     description: "An additional cache key that is stable over multiple jobs" | ||||
|     required: false | ||||
|   working-directory: | ||||
|     description: "The working directory this action should operate in" | ||||
|     required: false | ||||
|  |  | |||
|  | @ -49,14 +49,19 @@ export async function getCacheConfig(): Promise<CacheConfig> { | |||
| 
 | ||||
|   let key = `v0-rust-`; | ||||
| 
 | ||||
|   let inputKey = core.getInput("key"); | ||||
|   if (inputKey) { | ||||
|     key += `${inputKey}-`; | ||||
|   } | ||||
|   const sharedKey = core.getInput("sharedKey"); | ||||
|   if (sharedKey) { | ||||
|     key += `${sharedKey}-`; | ||||
|   } else { | ||||
|     const inputKey = core.getInput("key"); | ||||
|     if (inputKey) { | ||||
|       key += `${inputKey}-`; | ||||
|     } | ||||
| 
 | ||||
|   const job = process.env.GITHUB_JOB; | ||||
|   if (job) { | ||||
|     key += `${job}-`; | ||||
|     const job = process.env.GITHUB_JOB; | ||||
|     if (job) { | ||||
|       key += `${job}-`; | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   key += await getRustKey(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue