appleboy / appleboy/scp-action

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

Open
#178 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
1.6k
Forks
178
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the workflow YAML in the issue, especially the GITHUB_PATH update and the appleboy/scp-action step. Inspect /bin/entrypoint.sh at line 7 and compare the available PATH and shell commands in the GitHub environment. Done means the scp action runs without the “sh: not found” error.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, shell
Domain
ci-cd, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.