muhamedzeema / appgallery-deply-action

6 stars 7 forks source link

Action is always publishing the app even with submit set to false #6

Closed dinisnunes1 closed 2 years ago

dinisnunes1 commented 2 years ago

Problem: Action is always publishing the app even with submit set to false. I can check the logs and see the successfully submitted 🎉🎉🎉🎉🎉🎉 message if I set submit to false or true.

Solution: Validate which type the submit input type really is, because the if condition if (submit) {} is always being executed.

Some Tests: After some tests and reading the docs, the input type will collect the submit option as string (and not boolean as it is described in the readme file). So the if condition if(submit){} is always being executed.

A quick test doing a console.log(typeof submit) returned string. So the solution is to replace the if condition here https://github.com/muhamedzeema/appgallery-deply-action/blob/main/index.js#L190 with:

if(submit === 'true'){
   //submit code here
}
dinisnunes1 commented 2 years ago

@muhamedzeema I will open a PR with a fix

muhamedzeema commented 2 years ago

merged, thank you @dinisnunes1