mirror of
https://github.com/nektos/act.git
synced 2026-04-26 01:15:51 +03:00
[GH-ISSUE #2090] Add an additional argument --shell to open an act generated docker container #1000
Labels
No labels
area/action
area/cli
area/docs
area/image
area/runner
area/workflow
backlog
confirmed/not-planned
kind/bug
kind/discussion
kind/external
kind/feature-request
kind/question
meta/duplicate
meta/invalid
meta/need-more-info
meta/resolved
meta/wontfix
meta/workaround
needs-work
pull-request
review/not-planned
size/M
size/XL
size/XXL
stale
stale-exempt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/act#1000
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @wolfiex on GitHub (Nov 12, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/2090
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
--shellargument.@jpivarski commented on GitHub (Jan 24, 2024):
+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
runsteps, 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.
@robert-smith-maersk commented on GitHub (May 24, 2024):
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...
@SaswatPadhi commented on GitHub (Oct 1, 2024):
Having such a flag would be nice.
This is what I currently do:
If the build fails (
||) thendocker execinto the latest container and runbash.@rafl commented on GitHub (Apr 25, 2025):
What I currently do for this purpose is creating a reverse shell in my actions at point where I'd like to debug, kinda like a breakpoint, for example using
- run: socat EXEC:"bash -i",pty,stderr,setsid,sigint,sane TCP-CONNECT:host.docker.internal:4444. On the host, I wait for incoming debug connections usingsocat TCP4-LISTEN:4444,reuseaddr,fork STDIO,raw,echo=0, which provides a decently usable terminal within the environment of the action being executed.Using the same approach, and with just a small additional wrapper, you can even get a tmux session that'll spawn a new window for any new incoming debug connection, which is handy when running multiple workflows in parallel.
While this has been working pretty well for me, it would be nice to have a feature like this built in.
https://github.com/namespacelabs/breakpoint is a project related to this issue, and their breakpoint action could probably be extended to work locally via act as well.