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

Script fails to run but action succeeds

Open furacas opened this issue 2 years ago • 11 comments

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

furacas avatar Feb 13 '23 01:02 furacas

@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.

gigsta12 avatar Feb 19 '23 16:02 gigsta12

@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

furacas avatar Feb 20 '23 08:02 furacas

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.

easingthemes avatar Feb 20 '23 21:02 easingthemes

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.

domstubbs avatar Feb 21 '23 12:02 domstubbs

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]

durch avatar Mar 01 '23 11:03 durch

+1

vicenterzl avatar Mar 22 '23 10:03 vicenterzl

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] avatar Apr 22 '23 01:04 github-actions[bot]

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] avatar May 24 '23 01:05 github-actions[bot]

+1

liushuai05 avatar May 18 '24 10:05 liushuai05

+1

weblink-hr avatar May 22 '24 19:05 weblink-hr

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

Koswu avatar Jun 03 '24 15:06 Koswu

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

SCRIPT_AFTER_REQUIRED: true

easingthemes avatar Jul 24 '24 17:07 easingthemes