Skip to content

Commit 699abbc

Browse files
Copilotpelikhan
andauthored
Guard reflected repo target assertion
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
1 parent 619c237 commit 699abbc

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

pkg/workflow/safe_outputs_tools_repo_params.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,12 @@ func newRepoTargetAccessor(structField string) repoTargetAccessor {
6363
return nil
6464
}
6565
output = output.Elem()
66+
allowedRepos, ok := output.FieldByName("AllowedRepos").Interface().([]string)
67+
if !ok {
68+
return nil
69+
}
6670
return &repoTargetConfig{
67-
allowedRepos: output.FieldByName("AllowedRepos").Interface().([]string),
71+
allowedRepos: allowedRepos,
6872
targetRepoSlug: output.FieldByName("TargetRepoSlug").String(),
6973
}
7074
}

0 commit comments

Comments
 (0)