Open nihohit opened 2 months ago
If you have the $GITHUB_PATH
step in your github action, you probably need to do something like sudo -E
so that the updated $PATH
environment variable is carried over.
However, postgres itself refuses to run as root so I'm not sure what you're doing will work at all.
However, postgres itself refuses to run as root so I'm not sure what you're doing will work at all.
It works, I assume thanks to the sudo
call in pgtemp.
As for using sudo -E
- it seems like it isn't supported by the sudo
in the runner:
Run sudo -E
usage: sudo -h | -K | -k | -V
usage: sudo -v [-ABkNnS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-ABkNnS] [-g group] [-h host] [-p prompt] [-U user]
[-u user] [command [arg ...]]
usage: sudo [-ABbEHkNnPS] [-r role] [-t type] [-C num] [-D directory]
[-g group] [-h host] [-p prompt] [-R directory] [-T timeout]
[-u user] [VAR=value] [-i | -s] [command [arg ...]]
usage: sudo -e [-ABkNnS] [-r role] [-t type] [-C num] [-D directory]
[-g group] [-h host] [-p prompt] [-R directory] [-T timeout]
[-u user] file ...
I'm not sure that there is a solution to this issue 🤷
It works, I assume thanks to the sudo call in pgtemp.
Ah, I had gone back and forth on whether to include that feature and forgot that I actually ended up keeping it.
I'm not sure why it isn't working for you in github actions then. You definitely have the $GITHUB_PATH
step included in your action prior to starting pgtemp?
Yup, github path is set in an earlier step and PATH is echoed in the test step to verify that it includes the postgresql dir, but 'sudo' doesn't use the updated path.
On Tue, 9 Jul 2024, 23:36 Harry Stern, @.***> wrote:
It works, I assume thanks to the sudo call in pgtemp.
Ah, I had gone back and forth on whether to include that feature and forgot that I actually ended up keeping it.
I'm not sure why it isn't working for you in github actions then. You definitely have the $GITHUB_PATH step included in your action prior to starting pgtemp?
— Reply to this email directly, view it on GitHub https://github.com/boustrophedon/pgtemp/issues/8#issuecomment-2218686203, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDEBBULSFO7BX4TD7BH7H3ZLRCWXAVCNFSM6AAAAABKSP4IOKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJYGY4DMMRQGM . You are receiving this because you authored the thread.Message ID: @.***>
When I try to use this in Github Actions I get these errors:
from what I see, this happens because
sudo
can't findinitdb
in its secure path - adding the path to postgres to$PATH
doesn't solve the issue. I mitigated the issue by copying the wholepostgresql
bin &lib folders into/usr/bin
&/usr/lib
respectively, but it would be nice if the library could handle this.