Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 3
Message 1 of 2

Running interactive flows with "expect" script in Actions

Solved! Go to Solution.

Hi all,

 

I have an interactive 3rd party Node.js script to be run as part of a job. I've automated the responses with `(auto)expect` and trying to run `expect` script instead. That works fine locally, but hangs in Actions - relevant step never completes (and shows no output when running).

 

After some investigation I've found that `expect`-ing Bash scripts works, it is Node script that causes issues.

 

I have reproduced the issue in separate clean repo, where you can see "shell" job passes and "node" job hangs - https://github.com/khitrenovich/github-actions-expect-test/actions.

 

Any advices are welcome.

 

Thanks in advance!

1 Reply
Solution
Copilot Lvl 3
Message 2 of 2

Re: Running interactive flows with "expect" script in Actions

After digging more into that, I managed to trace the problem down to the special formatting characters that "expect" was... well, expecting. Running the original Node program on my Ubuntu box resulted in prettier prompt than the prompt that was (supposedly) generated on "dumb" terminal in Actions. Changing the expect script to wait for the plain prompt text solved the issue for me.

 

I realize it's not "one size fits all" solution, but at least I know that in general "expect+Node.js" combination is usable in GitHub Actions.