FTP-Deploy-Action icon indicating copy to clipboard operation
FTP-Deploy-Action copied to clipboard

dry-run didn't work w/ dangerous-clean-slate :/

Open iBotPeaches opened this issue 3 years ago • 1 comments

Bug Description Using dry-run with dangerous-clean-slate does not work.

My Action Config

      - name: Upload Website
        uses: SamKirkland/[email protected]
        with:
          server: ${{ steps.vars.outputs.website_host }}
          username: ${{ steps.vars.outputs.website_username }}
          password: ${{ steps.vars.outputs.website_password }}
          protocol: 'ftps'
          local-dir: website/dist/
          server-dir: ${{ steps.vars.outputs.website_folder }}
          dangerous-clean-slate: true
          dry-run: true

My Action Log

Run SamKirkland/[email protected]
----------------------------------------------------------------
🚀 Thanks for using ftp-deploy. Let's deploy some stuff!   
----------------------------------------------------------------
If you found this project helpful, please support it
by giving it a ⭐ on Github --> https://github.com/SamKirkland/FTP-Deploy-Action
or add a badge 🏷️ to your projects readme --> https://github.com/SamKirkland/FTP-Deploy-Action#badge
----------------------------------------------------------------
🗑️ Removing all files on the server because 'dangerous-clean-slate' was set, this will make the deployment very slow...
Clear complete
----------------------------------------------------------------

I was testing a move from Jenkins to GH Actions and this dry-run looked sweet. However, after my test my testing server is completely blank in the intended folder. It seems the entire directory was deleted, but the dry-run partially worked since none of my files uploaded.

It appears this is because this line on the parent repo never checks for the other property dry-run and thus deletes regardless of the flag - https://github.com/SamKirkland/ftp-deploy/blob/master/src/deploy.ts#L73

iBotPeaches avatar May 18 '22 18:05 iBotPeaches

Sorry about that. Thanks for the bug report!

SamKirkland avatar May 27 '22 20:05 SamKirkland