easingthemes / ssh-deploy

GitHub Action for deploying code via rsync over ssh. (with NodeJS)
MIT License
1.19k stars 146 forks source link

Script fails to run but action succeeds #115

Closed furacas closed 3 months ago

furacas commented 1 year ago

I have some scripts that may fail to run, but the Action always succeeds whether it fails or not, I can't get the message that the Action's run failed

gigsta12 commented 1 year ago

@furacas Are you providing the full path to the script you are wanting to run? Alternatively you could also cd to the directory within the SCRIPT_AFTER and then call the script.

furacas commented 1 year ago

@furacas Are you providing the full path to the script you are wanting to run? Alternatively you could also cd to the directory within the SCRIPT_AFTER and then call the script.

sure, What I want to express is that the script fails to run, but the Github Action runs successfully. I expect that when the script fails to run, Github Action prompts failure

easingthemes commented 1 year ago

Currently main action task is rsync deployment. SSH scripts before/after are only logging results or error. I can add additional param / env var to control this behaviour. Default will still be just logging.

domstubbs commented 1 year ago

That would be really handy – we’re running migrations and reloading services in our post-deploy script, so any failures there are serious and we need to know about them. The individual action logs aren’t likely to be reviewed if they’re being logged as successful.

Thanks for the action, it’s a real timesaver.

durch commented 1 year ago

Tacking on to this, we're seeing succesful taks even when rsync fails, logs below:

❌ [Rsync] error: 
Error: rsync exited with code 23
    at ChildProcess.<anonymous> (/home/runner/work/_actions/easingthemes/ssh-deploy/main/dist/index.js:2:2603)
    at ChildProcess.emit (node:events:527:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) {
  code: 23
}
❌ [Rsync] stderr: 
rsync: [generator] recv_generator: mkdir "<dir-name>" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1333) [sender=3.2.3]
vicenterzl commented 1 year ago

+1

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

liushuai05 commented 5 months ago

+1

weblink-hr commented 5 months ago

+1

Koswu commented 5 months ago

Seems This project is supported this feature with this MR.

Just use easingthemes/ssh-deploy@main and pass SCRIPT_AFTER_REQUIRED = true variable to it.

Maybe we should mention it in the README.md

easingthemes commented 3 months ago

Readme updated: https://github.com/easingthemes/ssh-deploy/blob/main/README.md#12-script_after_required-optional-default-false

SCRIPT_AFTER_REQUIRED: true