mirror of
				https://github.com/actions/setup-dotnet.git
				synced 2025-10-31 19:33:45 +00:00 
			
		
		
		
	update parser to v4
This commit is contained in:
		
							parent
							
								
									cf081e76a2
								
							
						
					
					
						commit
						90642fa8c5
					
				
							
								
								
									
										2313
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2313
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										33
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										33
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @ -14,7 +14,7 @@ | ||||
|         "@actions/github": "^1.1.0", | ||||
|         "@actions/http-client": "^2.0.1", | ||||
|         "@actions/io": "^1.0.2", | ||||
|         "fast-xml-parser": "^3.15.1", | ||||
|         "fast-xml-parser": "^4.0.10", | ||||
|         "semver": "^6.3.0", | ||||
|         "xmlbuilder": "^13.0.2" | ||||
|       }, | ||||
| @ -1992,12 +1992,14 @@ | ||||
|       "dev": true | ||||
|     }, | ||||
|     "node_modules/fast-xml-parser": { | ||||
|       "version": "3.17.4", | ||||
|       "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-3.17.4.tgz", | ||||
|       "integrity": "sha512-qudnQuyYBgnvzf5Lj/yxMcf4L9NcVWihXJg7CiU1L+oUCq8MUnFEfH2/nXR/W5uq+yvUN1h7z6s7vs2v1WkL1A==", | ||||
|       "hasInstallScript": true, | ||||
|       "version": "4.0.10", | ||||
|       "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.0.10.tgz", | ||||
|       "integrity": "sha512-mYMMIk7Ho1QOiedyvafdyPamn1Vlda+5n95lcn0g79UiCQoLQ2xfPQ8m3pcxBMpVaftYXtoIE2wrNTjmLQnnkg==", | ||||
|       "dependencies": { | ||||
|         "strnum": "^1.0.5" | ||||
|       }, | ||||
|       "bin": { | ||||
|         "xml2js": "cli.js" | ||||
|         "fxparser": "src/cli/cli.js" | ||||
|       }, | ||||
|       "funding": { | ||||
|         "type": "paypal", | ||||
| @ -4204,6 +4206,11 @@ | ||||
|         "node": ">=6" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/strnum": { | ||||
|       "version": "1.0.5", | ||||
|       "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", | ||||
|       "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==" | ||||
|     }, | ||||
|     "node_modules/supports-color": { | ||||
|       "version": "7.1.0", | ||||
|       "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", | ||||
| @ -6293,9 +6300,12 @@ | ||||
|       "dev": true | ||||
|     }, | ||||
|     "fast-xml-parser": { | ||||
|       "version": "3.17.4", | ||||
|       "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-3.17.4.tgz", | ||||
|       "integrity": "sha512-qudnQuyYBgnvzf5Lj/yxMcf4L9NcVWihXJg7CiU1L+oUCq8MUnFEfH2/nXR/W5uq+yvUN1h7z6s7vs2v1WkL1A==" | ||||
|       "version": "4.0.10", | ||||
|       "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.0.10.tgz", | ||||
|       "integrity": "sha512-mYMMIk7Ho1QOiedyvafdyPamn1Vlda+5n95lcn0g79UiCQoLQ2xfPQ8m3pcxBMpVaftYXtoIE2wrNTjmLQnnkg==", | ||||
|       "requires": { | ||||
|         "strnum": "^1.0.5" | ||||
|       } | ||||
|     }, | ||||
|     "fb-watchman": { | ||||
|       "version": "2.0.1", | ||||
| @ -7967,6 +7977,11 @@ | ||||
|       "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", | ||||
|       "dev": true | ||||
|     }, | ||||
|     "strnum": { | ||||
|       "version": "1.0.5", | ||||
|       "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", | ||||
|       "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==" | ||||
|     }, | ||||
|     "supports-color": { | ||||
|       "version": "7.1.0", | ||||
|       "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", | ||||
|  | ||||
| @ -29,7 +29,7 @@ | ||||
|     "@actions/github": "^1.1.0", | ||||
|     "@actions/http-client": "^2.0.1", | ||||
|     "@actions/io": "^1.0.2", | ||||
|     "fast-xml-parser": "^3.15.1", | ||||
|     "fast-xml-parser": "^4.0.10", | ||||
|     "semver": "^6.3.0", | ||||
|     "xmlbuilder": "^13.0.2" | ||||
|   }, | ||||
|  | ||||
| @ -3,7 +3,7 @@ import * as path from 'path'; | ||||
| import * as core from '@actions/core'; | ||||
| import * as github from '@actions/github'; | ||||
| import * as xmlbuilder from 'xmlbuilder'; | ||||
| import * as xmlParser from 'fast-xml-parser'; | ||||
| import {XMLParser} from 'fast-xml-parser'; | ||||
| 
 | ||||
| export function configAuthentication( | ||||
|   feedUrl: string, | ||||
| @ -66,7 +66,12 @@ function writeFeedToFile( | ||||
|   if (fs.existsSync(existingFileLocation)) { | ||||
|     // get key from existing NuGet.config so NuGet/dotnet can match credentials
 | ||||
|     const curContents: string = fs.readFileSync(existingFileLocation, 'utf8'); | ||||
|     const json = xmlParser.parse(curContents, {ignoreAttributes: false}); | ||||
| 
 | ||||
|     const parserOptions = { | ||||
|       ignoreAttributes: false | ||||
|     }; | ||||
|     const parser = new XMLParser(parserOptions); | ||||
|     const json = parser.parse(curContents); | ||||
| 
 | ||||
|     if (typeof json.configuration === 'undefined') { | ||||
|       throw new Error(`The provided NuGet.config seems invalid.`); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user