mirror of
				https://gitea.com/actions/cache.git
				synced 2025-10-31 07:47:07 +00:00 
			
		
		
		
	Make sure ref is not null or empty
This commit is contained in:
		
							
								
								
									
										2
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							| @@ -3309,7 +3309,7 @@ exports.resolvePaths = resolvePaths; | |||||||
| // Cache token authorized for all events that are tied to a ref | // Cache token authorized for all events that are tied to a ref | ||||||
| // See GitHub Context https://help.github.com/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#github-context | // See GitHub Context https://help.github.com/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#github-context | ||||||
| function isValidEvent() { | function isValidEvent() { | ||||||
|     return constants_1.RefKey in process.env; |     return constants_1.RefKey in process.env && Boolean(process.env[constants_1.RefKey]); | ||||||
| } | } | ||||||
| exports.isValidEvent = isValidEvent; | exports.isValidEvent = isValidEvent; | ||||||
| function unlinkFile(path) { | function unlinkFile(path) { | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							| @@ -3309,7 +3309,7 @@ exports.resolvePaths = resolvePaths; | |||||||
| // Cache token authorized for all events that are tied to a ref | // Cache token authorized for all events that are tied to a ref | ||||||
| // See GitHub Context https://help.github.com/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#github-context | // See GitHub Context https://help.github.com/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#github-context | ||||||
| function isValidEvent() { | function isValidEvent() { | ||||||
|     return constants_1.RefKey in process.env; |     return constants_1.RefKey in process.env && Boolean(process.env[constants_1.RefKey]); | ||||||
| } | } | ||||||
| exports.isValidEvent = isValidEvent; | exports.isValidEvent = isValidEvent; | ||||||
| function unlinkFile(path) { | function unlinkFile(path) { | ||||||
|   | |||||||
| @@ -115,7 +115,7 @@ export async function resolvePaths(patterns: string[]): Promise<string[]> { | |||||||
| // Cache token authorized for all events that are tied to a ref | // Cache token authorized for all events that are tied to a ref | ||||||
| // See GitHub Context https://help.github.com/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#github-context | // See GitHub Context https://help.github.com/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#github-context | ||||||
| export function isValidEvent(): boolean { | export function isValidEvent(): boolean { | ||||||
|     return RefKey in process.env; |     return RefKey in process.env && Boolean(process.env[RefKey]); | ||||||
| } | } | ||||||
|  |  | ||||||
| export function unlinkFile(path: fs.PathLike): Promise<void> { | export function unlinkFile(path: fs.PathLike): Promise<void> { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Aiqiao Yan
					Aiqiao Yan