FTP-Deploy-Action
FTP-Deploy-Action copied to clipboard
NEW FEATURE: support file permissions
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
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
Yes, this would be nice to specify a file and the permissions it needs
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
I implemented this today. There is a pull request waiting review.
@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.
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.