Added field key to validation message
This commit is contained in:
		
							parent
							
								
									ff832e4e77
								
							
						
					
					
						commit
						82ccbba7dc
					
				
							
								
								
									
										7
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							@ -596,9 +596,10 @@ const sshDeploy = (() => {
 | 
			
		||||
})();
 | 
			
		||||
 | 
			
		||||
const validateInputs = (inputs) => {
 | 
			
		||||
    const validInputs = inputs.filter(input => {
 | 
			
		||||
    const validInputs = Object.keys(inputs).filter((key) => {
 | 
			
		||||
        const input = inputs[key];
 | 
			
		||||
        if (!input) {
 | 
			
		||||
            console.error(`⚠️ ${input} is mandatory`);
 | 
			
		||||
            console.error(`⚠️ ${key} is mandatory`);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return input;
 | 
			
		||||
@ -610,7 +611,7 @@ const validateInputs = (inputs) => {
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const run = () => {
 | 
			
		||||
    validateInputs([SSH_PRIVATE_KEY, REMOTE_HOST, REMOTE_USER]);
 | 
			
		||||
    validateInputs({SSH_PRIVATE_KEY, REMOTE_HOST, REMOTE_USER});
 | 
			
		||||
 | 
			
		||||
    sshDeploy.init({
 | 
			
		||||
        src: GITHUB_WORKSPACE + '/' + SOURCE || '',
 | 
			
		||||
 | 
			
		||||
@ -121,9 +121,10 @@ const sshDeploy = (() => {
 | 
			
		||||
})();
 | 
			
		||||
 | 
			
		||||
const validateInputs = (inputs) => {
 | 
			
		||||
    const validInputs = inputs.filter(input => {
 | 
			
		||||
    const validInputs = Object.keys(inputs).filter((key) => {
 | 
			
		||||
        const input = inputs[key];
 | 
			
		||||
        if (!input) {
 | 
			
		||||
            console.error(`⚠️ ${input} is mandatory`);
 | 
			
		||||
            console.error(`⚠️ ${key} is mandatory`);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return input;
 | 
			
		||||
@ -135,7 +136,7 @@ const validateInputs = (inputs) => {
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const run = () => {
 | 
			
		||||
    validateInputs([SSH_PRIVATE_KEY, REMOTE_HOST, REMOTE_USER]);
 | 
			
		||||
    validateInputs({SSH_PRIVATE_KEY, REMOTE_HOST, REMOTE_USER});
 | 
			
		||||
 | 
			
		||||
    sshDeploy.init({
 | 
			
		||||
        src: GITHUB_WORKSPACE + '/' + SOURCE || '',
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user