actions / runner

The Runner for GitHub Actions :rocket:
https://github.com/features/actions
MIT License
4.86k stars 954 forks source link

`config.sh` and relative paths (`.so` files, `./bin/*`) #3237

Open ebarzilay-godaddy opened 6 months ago

ebarzilay-godaddy commented 6 months ago

Describe the bug

I ran into a problem that looked very much like #945 -- running config.sh had some complaints about missing .so files. After spending some time trying to figure out what's wrong, I realized that it was a very simple problem: config.sh is referring to .so files relatively to the current directory (example), so it fails to find it when called from someplace else.

Suggestion

An easy way to make it better is to just cd into the directory where config.sh is at the top, and that will make it independent from how it's executed. For example, some simple

cd "$(dirname "$0")"

or a variant as needed would do it.

To Reproduce

cd /some/directory
/path/to/config.sh

Expected behavior

Should run.

Runner Version and Platform etc

The problem exists in the current script.

ebarzilay-godaddy commented 6 months ago

@eeSquared @TingluoHuang ping

Sorry for the random ping, but you're the two most recent "staff" people that I saw in the commit list.

FWIW, this is an easy fix, and I'll be happy to do a PR if that will help.