mirror of
				https://github.com/actions/setup-java.git
				synced 2025-11-04 00:10:54 +00:00 
			
		
		
		
	Fixing issues with the handling of the token and avoiding error on when the token is undefined
This commit is contained in:
		
					parent
					
						
							
								78078da0cd
							
						
					
				
			
			
				commit
				
					
						86039b0e74
					
				
			
		
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -166,9 +166,13 @@ export function convertVersionToSemver(version: number[] | string) {
 | 
			
		|||
export function getGitHubHttpHeaders(): OutgoingHttpHeaders {
 | 
			
		||||
  const token = core.getInput('token');
 | 
			
		||||
  const auth = !token ? undefined : `token ${token}`;
 | 
			
		||||
 | 
			
		||||
  const headers: OutgoingHttpHeaders = {
 | 
			
		||||
    authorization: auth,
 | 
			
		||||
    accept: 'application/vnd.github.VERSION.raw'
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  if (auth) {
 | 
			
		||||
    headers.authorization = auth;
 | 
			
		||||
  }
 | 
			
		||||
  return headers;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue