act
act copied to clipboard
Add an additional argument `--shell` to open an act generated docker container
Act version
0.2.53
Feature description
When developing actions, it is often useful to explore the final state of the repository. For this using the interactive shell provides a suitable debug tool.
Currently this can be done using the commands outlined below.
Although already possible, there is no reason it should not be attached to the end of the act pipeline with a suggested --shell
argument.
# list all the containers, and identify the relevant one
docker ps -a
# launch an interactive shell using the container id
docker exec -it <container_id> /usr/bin/bash
+1 to this! The reason I installed act was because I thought it did this. Running GitHub Actions locally is nice—I can avoid the time spent waiting for a runner to launch—but I still need to wait for the initial (installation) steps to complete before reaching the step that I need to debug.
If there were an option to tell act to run the action and save a new Docker image at the point where the action failed, that would be ideal. (Saving a Docker image after success could be useful, too: I could remove the failing step and try commands interactively to determine what that step ought to be, for run
steps, anyway.)
I have tried the various alternatives that provide ssh access into a GitHub Action, but not with any success. With one of these (I can't remember which), I managed to connect but couldn't solve the problem before the connection timed out. Naturally, the timeout is for security reasons, but that's why debugging it locally would be an advantage.
Also, the command in the summary only gets you a new shell on the running image and some state is lost (environment variables etc.). It would be even better if act would leave the terminal session in which the workflow is run open and drop us into that...