From e1b1e81124145e276c23b6a64fb64b11eac6bbf6 Mon Sep 17 00:00:00 2001 From: Jason Song Date: Wed, 10 Apr 2024 06:53:28 +0000 Subject: [PATCH] Revert "Pass 'sleep' as container command rather than entrypoint (#86)" (#107) This reverts #86. Some images use a custom entry point for specific usage, then `[entrypoint] [cmd]` like `helm /bin/sleep 1` will failed. It causes https://gitea.com/gitea/helm-chart/actions/runs/755 since the image is `alpine/helm`. ```yaml check-and-test: runs-on: ubuntu-latest container: alpine/helm:3.14.3 ``` Reviewed-on: https://gitea.com/gitea/act/pulls/107 Reviewed-by: Lunny Xiao --- pkg/runner/run_context.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/runner/run_context.go b/pkg/runner/run_context.go index 307b35c..f3e3ff7 100644 --- a/pkg/runner/run_context.go +++ b/pkg/runner/run_context.go @@ -410,8 +410,8 @@ func (rc *RunContext) startJobContainer() common.Executor { jobContainerNetwork = networkName rc.JobContainer = container.NewContainer(&container.NewContainerInput{ - Cmd: []string{"/bin/sleep", fmt.Sprint(rc.Config.ContainerMaxLifetime.Round(time.Second).Seconds())}, - Entrypoint: nil, + Cmd: nil, + Entrypoint: []string{"/bin/sleep", fmt.Sprint(rc.Config.ContainerMaxLifetime.Round(time.Second).Seconds())}, WorkingDir: ext.ToContainerPath(rc.Config.Workdir), Image: image, Username: username,