feat(git): include link in report (#1698)

This commit is contained in:
Richard Gomez authored and GitHub committed 2025-01-19 14:03:57 -06:00
1 parent 0e3f4f7abb
commit 3c7f3f0e08
16 files changed
+498 -185

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
package scm
import (
"fmt"
"strings"
)
type Platform int
const (
NoPlatform Platform = iota
GitHubPlatform
GitLabPlatform
// TODO: Add others.
)
func (p Platform) String() string {
return [...]string{
"none",
"github",
"gitlab",
}[p]
}
func PlatformFromString(s string) (Platform, error) {
switch strings.ToLower(s) {
case "", "none":
return NoPlatform, nil
case "github":
return GitHubPlatform, nil
case "gitlab":
return GitLabPlatform, nil
default:
return NoPlatform, fmt.Errorf("invalid scm platform value: %s", s)
}
}