mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-12 22:10:25 +00:00
chore(tests): allow actions.InsertRun to be used when no job exists
It will never happen in production but is convenient when unit testing.
This commit is contained in:
parent
bf7c63a2ae
commit
14e329b33c
1 changed files with 4 additions and 2 deletions
|
|
@ -350,8 +350,10 @@ func InsertRun(ctx context.Context, run *ActionRun, jobs []*jobparser.SingleWork
|
|||
Status: status,
|
||||
})
|
||||
}
|
||||
if err := db.Insert(ctx, runJobs); err != nil {
|
||||
return err
|
||||
if len(runJobs) > 0 {
|
||||
if err := db.Insert(ctx, runJobs); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// if there is a job in the waiting status, increase tasks version.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue