aboutsummaryrefslogtreecommitdiffstats
path: root/models/actions/task.go
diff options
context:
space:
mode:
authorJason Song <i@wolfogre.com>2023-02-28 18:20:36 +0800
committerGitHub <noreply@github.com>2023-02-28 18:20:36 +0800
commitcbc9a0fe477b1b8af249ca0b8dac5fc2be64e9f6 (patch)
treecca5804520e6fcc5bfb3d388932743331fde3096 /models/actions/task.go
parent067b0c2664d127c552ccdfd264257caca4907a77 (diff)
downloadgitea-cbc9a0fe477b1b8af249ca0b8dac5fc2be64e9f6.tar.gz
gitea-cbc9a0fe477b1b8af249ca0b8dac5fc2be64e9f6.zip
Avoid too long names for actions (#23162)
The name of the job or step comes from the workflow file, while the name of the runner comes from its registration. If the strings used for these names are too long, they could cause db issues.
Diffstat (limited to 'models/actions/task.go')
-rw-r--r--models/actions/task.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/models/actions/task.go b/models/actions/task.go
index 5b6206c346..ffec4c92aa 100644
--- a/models/actions/task.go
+++ b/models/actions/task.go
@@ -298,8 +298,9 @@ func CreateTaskForRunner(ctx context.Context, runner *ActionRunner) (*ActionTask
if len(workflowJob.Steps) > 0 {
steps := make([]*ActionTaskStep, len(workflowJob.Steps))
for i, v := range workflowJob.Steps {
+ name, _ := util.SplitStringAtByteN(v.String(), 255)
steps[i] = &ActionTaskStep{
- Name: v.String(),
+ Name: name,
TaskID: task.ID,
Index: int64(i),
RepoID: task.RepoID,