Skip to content

How do I delete a file via FTP after deployment? #25005

Answered by MrYossu
MrYossu asked this question in Actions
Discussion options

You must be logged in to vote

OK, ignore the previous. Seems the syntax was wrong. I changed the code to…

    steps:
    - name: rename file
      shell: python
      run: |
        import ftplib
        ftp = ftplib.FTP('${{ secrets.PIXATATESTFTPSERVER }}')
        ftp.login('${{ secrets.PIXATATESTFTPUSER }}', '${{ secrets.PIXATATESTFTPPASSWORD }}')
        ftp.delete('jim.txt')
        ftp.quit()

…and it worked fine.

Thanks again

Replies: 9 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants