From 7f90c8acb252825d2b4098df06edb75f02010c90 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 28 Sep 2025 14:49:45 +0000 Subject: [PATCH] fix: do not attempt to run the LXC stop script with self-hosted (#1037) The test is covered by TestRunnerLXC which verifies the script actually runs on LXC. Resolves forgejo/runner#1035 - bug fixes - [PR](https://code.forgejo.org/forgejo/runner/pulls/1037): fix: do not attempt to run the LXC stop script with self-hosted Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/1037 Reviewed-by: fnetX Reviewed-by: Michael Kriese Reviewed-by: Mathieu Fenniak Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- act/runner/run_context.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/act/runner/run_context.go b/act/runner/run_context.go index bf74a92f..f344a046 100644 --- a/act/runner/run_context.go +++ b/act/runner/run_context.go @@ -254,6 +254,10 @@ func (rc *RunContext) stopHostEnvironment(ctx context.Context) error { logger := common.Logger(ctx) logger.Debugf("stopHostEnvironment") + if !rc.IsLXCHostEnv(ctx) { + return nil + } + var stopScript bytes.Buffer if err := stopTemplate.Execute(&stopScript, struct { Name string