Run single step on host OS

I’m running my tests in a custom container.
However, when I set a container on my job, it seems like every single step is run in it.
This is annoying for the checkout step, since git is not necessarily present or recent enough in the container I’m using.
Is there some way to tell it to run a step, namely the checkout one, just on the plain host, ubuntu-latest?

For reference, here’s the workflow I’m building:

It falls back to downloading a tarball, but that later fails some tools trying to get the git commit, at which point git has been installed.

When you specify jobs.<job_id>.container for a job, all the steps (exclude Docker Container Actions steps) will execute inside the container. So I would encourage you to install/upgrade the git client in your container . It is not possible to run checkout step in the hosted ubuntu-latest machine.

This would seem a very useful feature to add.
I’m using, in one case, off-the-shelve minimal containers, which I would really like to avoid forking and thus having to maintain myself, just to install git.
And the other container is an older Ubuntu version, which has git, but in a too old version. Updating it is out of the question, since we intentionally use that old Ubuntu to test we don’t break anything for it.

It’d seem generally quite useful, for more than just git, to be able to specify per-step which container to run the step in.
Maybe even while extending the Job-Container feature to support specifying multiple containers.
The ubuntu-latest one could then just be called “host” or “default”, while the other ones are explicitly named in the yml.

1 Like

Thank you for your detail explanation of your scenario. Would you mind sharing it and your requirement in the Feedback form for GitHub Actions? Your request will be noticed by developer team directly there.

I submitted the feedback as you suggested.
Now there’s only waiting and working around the issues for now.