mirror of
				https://gitea.com/docker/build-push-action.git
				synced 2025-10-31 00:58:18 +07:00 
			
		
		
		
	Merge pull request #470 from crazy-max/fix-outputs
Don't set outputs if empty or nil
This commit is contained in:
		
						commit
						291bae5a41
					
				
							
								
								
									
										8
									
								
								dist/index.js
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								dist/index.js
									
									
									
										generated
									
									
										vendored
									
									
								
							| @ -57,7 +57,7 @@ function getImageID() { | |||||||
|         if (!fs_1.default.existsSync(iidFile)) { |         if (!fs_1.default.existsSync(iidFile)) { | ||||||
|             return undefined; |             return undefined; | ||||||
|         } |         } | ||||||
|         return fs_1.default.readFileSync(iidFile, { encoding: 'utf-8' }); |         return fs_1.default.readFileSync(iidFile, { encoding: 'utf-8' }).trim(); | ||||||
|     }); |     }); | ||||||
| } | } | ||||||
| exports.getImageID = getImageID; | exports.getImageID = getImageID; | ||||||
| @ -73,7 +73,11 @@ function getMetadata() { | |||||||
|         if (!fs_1.default.existsSync(metadataFile)) { |         if (!fs_1.default.existsSync(metadataFile)) { | ||||||
|             return undefined; |             return undefined; | ||||||
|         } |         } | ||||||
|         return fs_1.default.readFileSync(metadataFile, { encoding: 'utf-8' }); |         const content = fs_1.default.readFileSync(metadataFile, { encoding: 'utf-8' }).trim(); | ||||||
|  |         if (content === 'null') { | ||||||
|  |             return undefined; | ||||||
|  |         } | ||||||
|  |         return content; | ||||||
|     }); |     }); | ||||||
| } | } | ||||||
| exports.getMetadata = getMetadata; | exports.getMetadata = getMetadata; | ||||||
|  | |||||||
| @ -15,7 +15,7 @@ export async function getImageID(): Promise<string | undefined> { | |||||||
|   if (!fs.existsSync(iidFile)) { |   if (!fs.existsSync(iidFile)) { | ||||||
|     return undefined; |     return undefined; | ||||||
|   } |   } | ||||||
|   return fs.readFileSync(iidFile, {encoding: 'utf-8'}); |   return fs.readFileSync(iidFile, {encoding: 'utf-8'}).trim(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| export async function getMetadataFile(): Promise<string> { | export async function getMetadataFile(): Promise<string> { | ||||||
| @ -27,7 +27,11 @@ export async function getMetadata(): Promise<string | undefined> { | |||||||
|   if (!fs.existsSync(metadataFile)) { |   if (!fs.existsSync(metadataFile)) { | ||||||
|     return undefined; |     return undefined; | ||||||
|   } |   } | ||||||
|   return fs.readFileSync(metadataFile, {encoding: 'utf-8'}); |   const content = fs.readFileSync(metadataFile, {encoding: 'utf-8'}).trim(); | ||||||
|  |   if (content === 'null') { | ||||||
|  |     return undefined; | ||||||
|  |   } | ||||||
|  |   return content; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| export async function getSecretString(kvp: string): Promise<string> { | export async function getSecretString(kvp: string): Promise<string> { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user