1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-09-15 18:57:01 +00:00

fix: sum256 the container name so derivations do not overflow (#191)

For instance, the volume name derived from the workflow name may exceed the file system limit when the container name it is derived from is too long.

Fixes forgejo/runner#152

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/191
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
This commit is contained in:
Earl Warren 2025-07-25 09:44:25 +00:00 committed by earl-warren
parent 7e1a84b400
commit 53e26e56b1
4 changed files with 28 additions and 5 deletions

View file

@ -94,7 +94,7 @@ func (rc *RunContext) GetEnv() map[string]string {
}
func (rc *RunContext) jobContainerName() string {
return createSimpleContainerName(rc.Config.ContainerNamePrefix, "WORKFLOW-"+rc.Run.Workflow.Name, "JOB-"+rc.Name)
return createSimpleContainerName(rc.Config.ContainerNamePrefix, "WORKFLOW-"+common.Sha256(rc.Run.Workflow.Name), "JOB-"+rc.Name)
}
// networkName return the name of the network which will be created by `act` automatically for job,