Improve the explanation of workdir_parent config #519

Merged
Zettat123 merged 3 commits from improve-workdir-parent into main 2024-03-22 02:30:31 +00:00
Zettat123 commented 2024-03-19 09:06:58 +00:00 (Migrated from gitea.com)

Fix #512

act_runner adds a '/' before the path (see https://gitea.com/gitea/act_runner/src/commit/5977042b86f22454d51c8027a009cb0a40337e52/internal/app/run/runner.go#L186) . So workdir_parent doesn't need to have the prefix '/'.

If workdir_parent has the prefix '/', errors will occur when reading files from the job container.

Fix #512 act_runner adds a '/' before the path (see https://gitea.com/gitea/act_runner/src/commit/5977042b86f22454d51c8027a009cb0a40337e52/internal/app/run/runner.go#L186) . So `workdir_parent` doesn't need to have the prefix '/'. If `workdir_parent` has the prefix '/', errors will occur when reading files from the job container.
wolfogre commented 2024-03-20 05:53:22 +00:00 (Migrated from gitea.com)

Maybe we can simply fix the code to handle it instead of requesting it in the configuration.

Maybe we can simply fix the code to handle it instead of requesting it in the configuration.
Zettat123 commented 2024-03-20 06:45:44 +00:00 (Migrated from gitea.com)

I considered changing the code from

fmt.Sprintf("/%s/%s", r.cfg.Container.WorkdirParent, preset.Repository)

to

fmt.Sprintf("%s/%s", r.cfg.Container.WorkdirParent, preset.Repository)

My concern is that maybe some users are using this configuration. Should we introduce a BREAKING change?

I considered changing the code from ``` fmt.Sprintf("/%s/%s", r.cfg.Container.WorkdirParent, preset.Repository) ``` to ``` fmt.Sprintf("%s/%s", r.cfg.Container.WorkdirParent, preset.Repository) ``` My concern is that maybe some users are using this configuration. Should we introduce a BREAKING change?
wolfogre commented 2024-03-20 08:08:01 +00:00 (Migrated from gitea.com)

I mean:

fmt.Sprintf("/%s/%s", strings.TrimLeft(r.cfg.Container.WorkdirParent, "/"), preset.Repository)
I mean: ```go fmt.Sprintf("/%s/%s", strings.TrimLeft(r.cfg.Container.WorkdirParent, "/"), preset.Repository) ```
wolfogre (Migrated from gitea.com) approved these changes 2024-03-22 02:30:18 +00:00
Sign in to join this conversation.