// Implementation for basic Action-related operations. package actions import ( "fmt" "strings" ) // Returns a key that can be used as a directory / cache-key string // based on the provided Action repository url. func GetActionKey(url string) string { url = strings.ToLower(url) if strings.HasPrefix(url, "http://") { url = strings.TrimPrefix(url, "http://") } else if strings.HasPrefix(url, "https://") { url = strings.TrimPrefix(url, "https://") } parts := strings.Split(url, "/") return strings.Join(parts, "__") } func FormatInputEnvKey(inputKey string) string { return fmt.Sprintf("INPUT_%s", strings.ReplaceAll(strings.ToUpper(inputKey), " ", "_")) }