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

NEW FEATURE: support file permissions

Open feyst opened this issue 4 years ago • 6 comments

Bug Description When I only change the mode of a file (chmod +x ./src/file), then commit the change and push it. The ftp script does not seem to recognice the change. and does not alter the destination file mode.

My Action Config

on: push
name: 🚀 Deploy website on push
jobs:
  web-deploy:
    name: 🎉 Deploy
    runs-on: ubuntu-latest
    steps:
      - name: 🚚 Get latest code
        uses: actions/checkout@v2

      - name: Install dependencies
        uses: php-actions/composer@v6

      - name: 📂 Sync files
        uses: SamKirkland/[email protected]
        with:
          server: ${{ secrets.ftp_host }}
          protocol: ftps
          username: ${{ secrets.ftp_username }}
          password: ${{ secrets.ftp_password }}```

My Action Log

⚖️  File content is the same, doing nothing: src/file

feyst avatar Jul 24 '21 08:07 feyst

Currently this action does not support setting file permissions.

Keep in mind the only information git stores about the file is if it can be executed or not. You should have to update that via the update-index command (chmod would not save the information to git).

I have marked this issue as a enhancement. If other users request this feature it could be added via a new option specifying the file types to make executable, or by using the information set via update-index

SamKirkland avatar Jul 26 '21 14:07 SamKirkland

Yes, this would be nice to specify a file and the permissions it needs

thorst avatar Dec 19 '21 02:12 thorst

I need this, but unfortunately it ain't gonna be easy as the library FTP-Deploy-Action uses to upload to FTP doesn't support this for all FTP servers:

https://github.com/patrickjuchli/basic-ftp/issues/9

timthelion avatar Feb 02 '22 11:02 timthelion

I implemented this today. There is a pull request waiting review.

timthelion avatar Feb 02 '22 18:02 timthelion

@SamKirkland you can just add a chmod step in the github action flow file before the file sync if you need exotic file permissions. In my specific case, I had a hosting provider who's default file permissions were non-readable, so I just need to sync sane file permissions.

timthelion avatar Feb 02 '22 18:02 timthelion

You can use my fork ex: https://github.com/vegan-buddies/vegan-buddies/blob/20e437da95379930c7dd05cecd87f6fe1801fee0/.github/workflows/website.yml#L34 . Unfortunately, I don't have time to redo the pull request with the better design. Sorry.

timthelion avatar Jun 14 '22 12:06 timthelion