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

Unable to run bash script with master branch version

Open bobcoin98 opened this issue 1 year ago • 14 comments

/usr/bin/env: ‘bash’: Permission denied Error: Process completed with exit code 126.

Setting user to root already

bobcoin98 avatar Apr 17 '24 04:04 bobcoin98

image

bobcoin98 avatar Apr 17 '24 04:04 bobcoin98

@bobcoin98 Please post your yaml config.

appleboy avatar Apr 17 '24 06:04 appleboy

    - name: Test command SSH
      uses: appleboy/ssh-action@master
      with:
        host: ${{ secrets.HOST }}
        port: ${{ secrets.PORT }}
        username: ${{ secrets.USERNAME }}
        key: ${{ secrets.KEY }}
        script: cd ${{ secrets.PATH }}
 

if I put secrets in script like this, I got the error If I put plain text instead, then It works

bobcoin98 avatar Apr 17 '24 07:04 bobcoin98

reverting back to appleboy/[email protected] -> it works so please check your master branch

bobcoin98 avatar Apr 18 '24 08:04 bobcoin98

@bobcoin98 Can you post your raw data of yaml file?

appleboy avatar Apr 18 '24 14:04 appleboy

if I put secrets in script like this, I got the error If I put plain text instead, then It works

Is that true for the master version?

appleboy avatar Apr 18 '24 14:04 appleboy

if I put secrets in script like this, I got the error If I put plain text instead, then It works

Is that true for the master version?

yes, for master version, error occurs if I put any secret in script for v1.0.3, it works fine even I put some secret in script

bobcoin98 avatar Apr 18 '24 14:04 bobcoin98

v1.0.3 indeed works, master is broken!!!

ddjerqq avatar Apr 18 '24 22:04 ddjerqq

I will take a look master branch.

appleboy avatar May 05 '24 02:05 appleboy

Im experiencing the same issue; with latest it gives me error, but with 1.0.3 works fine.

after: https://github.com/EncryptEx/femtolink/actions/runs/10004445985/job/27653141107 before: https://github.com/EncryptEx/femtolink/actions/runs/10004371172/job/27652989509

EncryptEx avatar Jul 19 '24 07:07 EncryptEx

@EncryptEx Post your config?

appleboy avatar Jul 19 '24 07:07 appleboy

Here's mine https://github.com/EncryptEx/femtolink/blob/main/.github/workflows/deploy.yml in both job runs i ran the same command: sudo /path/to/file.sh

EncryptEx avatar Jul 19 '24 07:07 EncryptEx

@bobcoin98

I try your config. It is working on the master branch:

see the https://github.com/appleboy/ssh-action/actions/runs/10017868614/job/27692567991

Prepare all required actions
Run ./
Run echo "$GITHUB_ACTION_PATH" >> $GITHUB_PATH
Run entrypoint.sh
Will download drone-ssh-1.7.7-linux-amd64 from https://github.com/appleboy/drone-ssh/releases/download/v1.7.7
======= CLI Version =======
Drone SSH version 1.7.7
===========================
err: bash: line 1: cd: ***: No such file or directory
[2](https://github.com/appleboy/ssh-action/actions/runs/10017868614/job/27692567991#step:10:2)024/07/20 05:27:04 Process exited with status 1
Error: Process completed with exit code 1.

image

appleboy avatar Jul 20 '24 05:07 appleboy

@EncryptEx

Please try the following shell script:

sudo ls -al /path/to/file.sh
sudo chmod +x /path/to/file.sh
sudo /path/to/file.sh

Please post the result. Waiting for your feedback.

appleboy avatar Jul 20 '24 06:07 appleboy