mirror of
				https://github.com/actions/cache.git
				synced 2025-11-04 13:29:10 +08:00 
			
		
		
		
	Use parseInt instead of Number to handle empty strings
This commit is contained in:
		
							
								
								
									
										4
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							@@ -31354,8 +31354,8 @@ function getInputAsArray(name, options) {
 | 
			
		||||
}
 | 
			
		||||
exports.getInputAsArray = getInputAsArray;
 | 
			
		||||
function getInputAsInt(name, options) {
 | 
			
		||||
    const value = Number(core.getInput(name, options));
 | 
			
		||||
    if (Number.isNaN(value) || value < 0) {
 | 
			
		||||
    const value = parseInt(core.getInput(name, options));
 | 
			
		||||
    if (isNaN(value) || value < 0) {
 | 
			
		||||
        return undefined;
 | 
			
		||||
    }
 | 
			
		||||
    return value;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										4
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							@@ -31354,8 +31354,8 @@ function getInputAsArray(name, options) {
 | 
			
		||||
}
 | 
			
		||||
exports.getInputAsArray = getInputAsArray;
 | 
			
		||||
function getInputAsInt(name, options) {
 | 
			
		||||
    const value = Number(core.getInput(name, options));
 | 
			
		||||
    if (Number.isNaN(value) || value < 0) {
 | 
			
		||||
    const value = parseInt(core.getInput(name, options));
 | 
			
		||||
    if (isNaN(value) || value < 0) {
 | 
			
		||||
        return undefined;
 | 
			
		||||
    }
 | 
			
		||||
    return value;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user