appleboy / scp-action

GitHub Action that copy files and artifacts via SSH.
https://github.com/marketplace/actions/scp-command-to-transfer-files
MIT License
1.25k stars 135 forks source link

Unable to copy content of the artifact into target #191

Open gurpreet-fe opened 6 days ago

gurpreet-fe commented 6 days ago

Description I would like to copy only the contents of the artifact into the target directory.

Expected Behaviour The contents of the artifact should be copied directly into the target directory, without copying the artifact directory itself.

- name: Copy to server
        uses: appleboy/scp-action@v0.1.7
        with:
          host: ${{ secrets.HOST }}
          username: ${{ secrets.USERNAME }}
          password: ${{ secrets.PASSWORD }}
          source: dist/*
          target: ~/public_html/remote/
          rm: true

Actual Behaviour The entire artifact directory is copied to the target directory.

Screenshot 2024-11-16 at 18 14 47

eliezerfot123 commented 1 day ago

Hello, I also have the same problem apparently is not taking the or in case such paths example dist/folder/folder2/ in the final destination is coming the same structure remote/dist/folder/folder2/ when I really want to show in remote/ what is inside the folder2 would be great if you can fix this bug. Thanks

yarobash commented 1 day ago

Have the save issue.

brleonardo commented 8 hours ago

To solve this I had to use appleboy/ssh-action.

- name: Move files to root
        uses: appleboy/ssh-action@v1.0.3
        with:
          host: ${{ secrets.HOST }}
          username: ${{ secrets.USERNAME }}
          key: ${{ secrets.KEY }}
          port: ${{ secrets.PORT }}
          script: |
            cd *PATH TO PARENT DIRECTORY*
            mv dist/* .
            rm -rf dist/
arthurxxy commented 1 hour ago

Have the save issue.