| 
									
										
										
										
											2021-12-29 15:15:39 +00:00
										 |  |  | import fs from 'fs'; | 
					
						
							|  |  |  | import YAML from 'yaml'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export class ActionYamlReader { | 
					
						
							|  |  |  |   private actionYamlParsed: any; | 
					
						
							| 
									
										
										
										
											2021-12-29 15:53:44 +00:00
										 |  |  |   public constructor() { | 
					
						
							| 
									
										
										
										
											2021-12-29 15:15:39 +00:00
										 |  |  |     this.actionYamlParsed = YAML.parse(fs.readFileSync(`action.yml`).toString()); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   public GetActionYamlValue(key: string) { | 
					
						
							| 
									
										
										
										
											2021-12-29 18:15:23 +00:00
										 |  |  |     return this.actionYamlParsed.inputs[key]?.description || 'No description found in action.yml'; | 
					
						
							| 
									
										
										
										
											2021-12-29 15:15:39 +00:00
										 |  |  |   } | 
					
						
							|  |  |  | } |