-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Script exiting with non-zero exist status even if successful #92
Comments
Thank you for reporting this @laszlof 🙇 Please forgive my delay in responding.
If that's the last line in Could you share details about your runner's operating environment and the version of |
Looking around, I think this Action can't assume macOS and self-hosted runners provide a I stuffed the I'll look for alternative ways to populate octodns-sync.log AND check the result of In the meantime, I think Debian-based runners (like GitHub's hosted Ubuntu runners) should remain unaffected. |
@solvaholic apologies for the delay. My runner was on Ubuntu 18.04. What you mention about Question: Can we not rely on exit codes directly from I appreciate the work you put into this, saved me from having to write it all myself :) |
Definitely it should be possible, yes. The challenge I see is how to notice that exit code AND output the plan to a file AND output everything I'll keep looking, tho it'll probably be 09 Oct before I can put much time into it. I feel like the solution could be super simple, just need to research and test. For example, something like this might work: if ! octodns-sync >./plan.txt 2>./log.txt; then exit $?; fi |
@solvaholic The
shell redirection may be the answer, i dont think you'll be able to use I'll mess around with what you posted and give it a shot, If it works out, I'll submit a PR for it. |
Starting a Docker container this way: _image=python:3-bullseye
docker run --interactive --tty --rm \
--env-file .env \
--volume "$(realpath .)":/data \
--workdir /data \
"$_image" /bin/bash And running python3 -m pip install -r requirements.txt
octodns-sync --config-file public.yaml 1>plan.htm 2>log.txt; echo $? I find the redirects do what's expected, and the exit code survives, with these images: With Alpine I tested /bin/sh and /bin/ash, and used Dennis Joel suggestion in: With Fedora I did |
to create plan and log files. /cc #92
@laszlof When you have some minutes for it, will you try using the - uses: solvaholic/octodns-sync@issue92 My own testing says the change in afdbff0 should work fine. One side effect is the plan will no longer be captured in |
@solvaholic Will do. I'll try to get it today and report back. Thanks! |
@solvaholic That seemed to fix the issue, but we lost the script output from the sync. Not a huge issue, but it may be for some who regularly look at the actions console to see their job runs. |
Thank you for confirming, @laszlof 🙇
Thanks also for pointing out this change. The stdout of Somewhat related .. while looking for context I see this project used to use |
Description
I'm using this action to deploy some DNS configurations to some powerdns servers. However, when it attempts to run, the action bails out because of these lines returning a non-zero exit status:
https://github.com/solvaholic/octodns-sync/blob/main/scripts/run.sh#L31-L36
The sync itself actually works, its just failing the job in Actions.
Expected Behavior
Action completes successfully
Actual Behavior
Action fails a task with a non-zero exit status
Possible Fix
It appears that the problem is due to how you're determining if there is an error state. It could have something to do with the octodns version I'm using (0.9.19). If we break down that conditional that triggers the error state, here is what we have:
The text was updated successfully, but these errors were encountered: