diff options
author | Jason Song <i@wolfogre.com> | 2023-03-30 22:33:17 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-30 22:33:17 +0800 |
commit | 964a057a76793c32c81394505e2f480a4bf40d0d (patch) | |
tree | ff1cb54f30b43741c4a8c881ca0f2f0a7555e0c5 /models/actions/run.go | |
parent | aa4d1d94f79e8edd9fa9ff2813fea12b085b2cae (diff) | |
download | gitea-964a057a76793c32c81394505e2f480a4bf40d0d.tar.gz gitea-964a057a76793c32c81394505e2f480a4bf40d0d.zip |
Fix checks for `needs` in Actions (#23789)
Fix:
- https://gitea.com/gitea/act_runner/issues/77
- https://gitea.com/gitea/act_runner/issues/81
Before:
<img width="1489" alt="image"
src="https://user-images.githubusercontent.com/9418365/228501567-f752cf87-a7ed-42c6-8f3d-ba741795c1fe.png">
Highlights:
- Upgrade act to make things doable, related to
- https://gitea.com/gitea/act/pulls/32
- https://gitea.com/gitea/act/pulls/33
- https://gitea.com/gitea/act/pulls/35
- Make `needs` works
- Sort jobs in the original order in the workflow files
Diffstat (limited to 'models/actions/run.go')
-rw-r--r-- | models/actions/run.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/models/actions/run.go b/models/actions/run.go index 1af8f897fa..22041b65a9 100644 --- a/models/actions/run.go +++ b/models/actions/run.go @@ -197,7 +197,9 @@ func InsertRun(ctx context.Context, run *ActionRun, jobs []*jobparser.SingleWork for _, v := range jobs { id, job := v.Job() needs := job.Needs() - job.EraseNeeds() + if err := v.SetJob(id, job.EraseNeeds()); err != nil { + return err + } payload, _ := v.Marshal() status := StatusWaiting if len(needs) > 0 || run.NeedApproval { |