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 <xiaolunwen@gmail.com>
This commit is contained in:
Jason Song 2024-04-10 06:53:28 +00:00
parent 64876e3696
commit e1b1e81124
1 changed files with 2 additions and 2 deletions

View File

@ -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,