mirror of
				https://github.com/cmderdev/cmder.git
				synced 2025-10-31 09:22:15 +08:00 
			
		
		
		
	use github token when available
This commit is contained in:
		
							
								
								
									
										2
									
								
								.github/workflows/vendor.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/vendor.yml
									
									
									
									
										vendored
									
									
								
							| @@ -30,6 +30,8 @@ jobs: | |||||||
|  |  | ||||||
|     - id: make-changes |     - id: make-changes | ||||||
|       name: Checking for updates |       name: Checking for updates | ||||||
|  |       env: | ||||||
|  |         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||
|       run: | |       run: | | ||||||
|           $currentVersion = (Get-Content .\vendor\sources.json | ConvertFrom-Json) |           $currentVersion = (Get-Content .\vendor\sources.json | ConvertFrom-Json) | ||||||
|           . .\scripts\update.ps1 -verbose |           . .\scripts\update.ps1 -verbose | ||||||
|   | |||||||
| @@ -102,6 +102,12 @@ function Fetch-DownloadUrl { | |||||||
|  |  | ||||||
|     $p = $url.Segments.Split([Environment]::NewLine) |     $p = $url.Segments.Split([Environment]::NewLine) | ||||||
|  |  | ||||||
|  |     $headers = @{} | ||||||
|  |  | ||||||
|  |     if ($($env:GITHUB_TOKEN)) { | ||||||
|  |         $headers["Authorization"] = "token $($env:GITHUB_TOKEN)" | ||||||
|  |     } | ||||||
|  |  | ||||||
|     # Api server for GitHub |     # Api server for GitHub | ||||||
|     $urlHost = "api.github.com" |     $urlHost = "api.github.com" | ||||||
|  |  | ||||||
| @@ -110,7 +116,7 @@ function Fetch-DownloadUrl { | |||||||
|  |  | ||||||
|     $apiUrl = [uri] (New-Object System.UriBuilder -ArgumentList $url.Scheme, $urlHost, -1, $urlPath).Uri |     $apiUrl = [uri] (New-Object System.UriBuilder -ArgumentList $url.Scheme, $urlHost, -1, $urlPath).Uri | ||||||
|  |  | ||||||
|     $info = Invoke-RestMethod -Uri $apiUrl |     $info = Invoke-RestMethod -Uri $apiUrl -Headers $headers | ||||||
|  |  | ||||||
|     $downloadLinks = (New-Object System.Collections.Generic.List[System.Object]) |     $downloadLinks = (New-Object System.Collections.Generic.List[System.Object]) | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user