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.14k stars 134 forks source link

Error "/bin/entrypoint.sh: line 7: sh: not found" when I am using Github Environments #178

Open shir0fu opened 1 month ago

shir0fu commented 1 month ago

Hi!

When I use Github environments in my deploy script, I get a "command not found" error. I add the following code to my script:

      - name: Set PATH environment variable
        run: echo "PATH=\$PATH:/bin" >> $GITHUB_PATH

This solved my problem in particular. Now I can use ls command (for example) without errors, but when script runs code with appleboy/scp-action@master (or other version) I had an error /bin/entrypoint.sh: line 7: sh: not found

This is my complete .yml script

jobs:
  DEV:
    runs-on: ubuntu-latest
    environment: DEV
    steps:

      - name: Set PATH environment variable
        run: echo "PATH=\$PATH:/bin" >> $GITHUB_PATH

      - uses: thaind0/envfile@v1
        with:
          secrets: ${{ toJSON(secrets) }}
          file: temp.env 
      - run: |
          echo $GITHUB_PATH
          pwd
          ls -la

      - name: copy file via ssh key
        uses: appleboy/scp-action@master
        with:
          host: ${{ secrets.HOST }}
          username: username
          port: 22
          key: ${{ secrets.DEV_SSHKEY }}
          source: temp.env
          target: ${{ secrets.PATH }}

How can I fix this error or I need to wait for the problem to be resolved on the appleboy/scp-action@master side? @appleboy