muhamedzeema / appgallery-deply-action

6 stars 7 forks source link

[Hotfix] Fix submit input type to string #7

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.

Issue: https://github.com/muhamedzeema/appgallery-deply-action/issues/6

Solution Replace the if condition if (submit) {} (is always being executed) with:

if(submit === 'true'){
   //submit code here
}

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) retuned 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
}

Working version with submit: false (only upload)

app-gallery-submit-false

Working version with submit: true (upload and submit)

app-gallery-submit-true_