Skip to content

NEW FEATURE: support file permissions #209

Open
@feyst

Description

@feyst

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/FTP-Deploy-Action@4.1.0
        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

Activity

self-assigned this
on Jul 26, 2021
SamKirkland

SamKirkland commented on Jul 26, 2021

@SamKirkland
Owner

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

changed the title [-]`chmod +x` change is not detected[/-] [+]NEW FEATURE: support file permissions[/+] on Oct 11, 2021
thorst

thorst commented on Dec 19, 2021

@thorst

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

timthelion

timthelion commented on Feb 2, 2022

@timthelion

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:

patrickjuchli/basic-ftp#9

linked a pull request that will close this issue on Feb 2, 2022
timthelion

timthelion commented on Feb 2, 2022

@timthelion

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

timthelion

timthelion commented on Feb 2, 2022

@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.

added a commit that references this issue on Feb 13, 2022
timthelion

timthelion commented on Jun 14, 2022

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @thorst@timthelion@feyst@SamKirkland

    Issue actions

      NEW FEATURE: support file permissions · Issue #209 · SamKirkland/FTP-Deploy-Action