This is an automated email from the ASF dual-hosted git repository.
zhangliang2022 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/main by this push:
new 31a40aea9 fix: check array length before accessing (#4455)
31a40aea9 is described below
commit 31a40aea9dd7bd93a3d93870bfbc1455f8c75b93
Author: Klesh Wong <[email protected]>
AuthorDate: Mon Feb 20 17:13:26 2023 +0800
fix: check array length before accessing (#4455)
---
backend/plugins/github/tasks/cicd_run_collector.go | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/backend/plugins/github/tasks/cicd_run_collector.go
b/backend/plugins/github/tasks/cicd_run_collector.go
index 19d6b9d02..598967a5e 100644
--- a/backend/plugins/github/tasks/cicd_run_collector.go
+++ b/backend/plugins/github/tasks/cicd_run_collector.go
@@ -93,6 +93,10 @@ func CollectRuns(taskCtx plugin.SubTaskContext) errors.Error
{
return nil, err
}
+ if len(body.GithubWorkflowRuns) == 0 {
+ return nil, nil
+ }
+
// time filter or diff sync
if createdAfter != nil {
// if the first record of the page was created
before minCreated, return emtpy set and stop