mirror of
https://github.com/nektos/act.git
synced 2026-04-25 17:05:50 +03:00
[PR #6008] fix: guard GetHealth against nil docker client in dry-run mode #2661
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#2661
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?
📋 Pull Request Information
Original PR: https://github.com/nektos/act/pull/6008
Author: @veeceey
Created: 2/23/2026
Status: 🔄 Open
Base:
master← Head:fix/issue-5934-dryrun-nil-gethealth📝 Commits (1)
68ed563fix: guard GetHealth against nil docker client in dry-run mode📊 Changes
1 file changed (+4 additions, -0 deletions)
View changed files
📝
pkg/container/docker_run.go(+4 -0)📄 Description
When running
act -n(dry-run mode) with workflows that define service containers, the process panics with a SIGSEGV becauseGetHealth()tries to callContainerInspecton a nil docker client.In dry-run mode,
connect()is skipped via.IfNot(common.Dryrun), socr.cliis never set. ButwaitForServiceContainerstill callsGetHealth()unconditionally, which dereferences the nil client.The fix adds a nil check on
cr.cliat the top ofGetHealth()— if there's no client, we just returnHealthHealthyand move on. This matches the pattern already used byStart()andRemove()which skip execution during dry-run.Tested by verifying the build compiles cleanly. The existing container tests require a live Docker daemon so they can't run in CI-less environments, but the logic is straightforward — just a nil guard.
Fixes #5934
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.