You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Prepending PATH breaks the container environment if the image does not have PATH env #3210
I have encountered an issue with using a openSUSE container. The job fails as it cannot execute any commands after prepending PATH by $GITHUB_PATH.
To Reproduce
Here is a minimal manifest to reproduce the issue:
my-job:
runs-on: ubuntu-latestcontainer: opensuse/leapsteps:
- run: id
- run: echo "/tmp/.bin" >> $GITHUB_PATH
- run: id
The job runs successfully for the Debian container (container: debian), but with the openSUSE container (container: opensuse/leap), it fails with the following error message:
OCI runtime exec failed: exec failed: unable to start container process: exec: "sh": executable file not found in $PATH: unknown
Expected behavior
Any commands after prepending PATH should run successfully.
Runner Version and Platform
It can reproduce the current GitHub-hosted runners.
Container: The latest openSUSE official image (opensuse/leap)
What's not working?
The GitHub Actions agent prepends the user-configured PATH in the $GITHUB_PATH with the container's PATH. The agent retrieves the current PATH by docker inspect (ref.). If the docker container has a PATH configuration, the agent joins the configured PATH in the $GITHUB_PATH with the container's PATH, and pass by the -e option on the docker exec command (ref). If the docker image doesn't have a PATH configuration, the agent pass just -e PATH=/tmp/.bin option. This causes an error because sh does not exist in the passed PATH.
We can see that the openSUSE container image does not have the PATH configuration according to the output of the command docker image inspect.
Activity
github-actions commentedon Mar 17, 2025
This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 15 days.
github-actions commentedon Apr 7, 2025
This issue was closed because it has been stalled for 15 days with no activity.
imagetypes_container: add PATH variable to container config
imagetypes_container: add PATH variable to container config
imagetypes_container: add PATH variable to container config
Add explicit PATH to container
Add explicit PATH to container (#309)
ci: pin a base PATH for the Linux packages container
Link to latest Karst release from Devices page (#559)