scp-action icon indicating copy to clipboard operation
scp-action copied to clipboard

a dedicated setting for excluding folder

Open kirmola opened this issue 11 months ago • 5 comments

is it possible to exclude certain folders from being copied, if no, please add that

kirmola avatar May 11 '25 01:05 kirmola

@kirmola has this been added? Also looking for a way to exclude some files and folders

Obcodelab avatar May 29 '25 11:05 Obcodelab

Got a better way of doing it, you have to do individual files and folders separated by comma.

kirmola avatar May 29 '25 11:05 kirmola

You mean for my source?

Obcodelab avatar May 29 '25 11:05 Obcodelab

Yeah, I think it's highly unlikely that this feature would be implemented unless there is a specific reason, also, the current method just works, so I guess laziness wins.

kirmola avatar May 30 '25 02:05 kirmola

is it possible to exclude certain folders from being copied, if no, please add that

on source property, you can send a list of folders by separating them with commas. You can add a ! prefix to the ones you want to skip.

on the example below I copy everything from my . (root) folder except by my node_modules folder:

- name: Copy to server
        uses: appleboy/scp-action@v1
        with:
          host: ${{ secretsSERVER_HOST }}
          username: ${{ secrets.SERVER_USER }}
          port: ${{ secrets.SERVER_PORT }}
          key: ${{ secrets.SERVER_KEY }}
          source: '.,!node_modules'
          target: '~/app'
          overwrite: true
          rm: true
          timeout: 300s

ondanieldev avatar Jun 25 '25 17:06 ondanieldev