feat: go 1.25.5, dependency updates, renamed internal/errors (#129)

* feat: rename internal/errors to internal/apperrors

* fix(tests): clear env values before using in tests

* feat: rename internal/errors to internal/apperrors

* chore(deps): update go and all dependencies

* chore: remove renovate from pre-commit, formatting

* chore: sonarcloud fixes

* feat: consolidate constants to appconstants/constants.go

* chore: sonarcloud fixes

* feat: simplification, deduplication, test utils

* chore: sonarcloud fixes

* chore: sonarcloud fixes

* chore: sonarcloud fixes

* chore: sonarcloud fixes

* chore: clean up

* fix: config discovery, const deduplication

* chore: fixes
This commit is contained in:
2026-01-01 23:17:29 +02:00
committed by GitHub
parent 85a439d804
commit 7f80105ff5
65 changed files with 2321 additions and 1710 deletions

View File

@@ -11,6 +11,8 @@ import (
"os"
"path/filepath"
"strings"
"github.com/ivuorinen/gh-action-readme/appconstants"
)
// embeddedTemplates contains all template files embedded in the binary
@@ -24,8 +26,8 @@ func GetEmbeddedTemplate(templatePath string) ([]byte, error) {
cleanPath := strings.TrimPrefix(filepath.ToSlash(templatePath), "/")
// If path doesn't start with templates/, prepend it
if !strings.HasPrefix(cleanPath, "templates/") {
cleanPath = "templates/" + cleanPath
if !strings.HasPrefix(cleanPath, appconstants.DirTemplates) {
cleanPath = appconstants.DirTemplates + cleanPath
}
return embeddedTemplates.ReadFile(cleanPath)
@@ -39,8 +41,8 @@ func GetEmbeddedTemplateFS() fs.FS {
// IsEmbeddedTemplateAvailable checks if a template exists in the embedded filesystem.
func IsEmbeddedTemplateAvailable(templatePath string) bool {
cleanPath := strings.TrimPrefix(filepath.ToSlash(templatePath), "/")
if !strings.HasPrefix(cleanPath, "templates/") {
cleanPath = "templates/" + cleanPath
if !strings.HasPrefix(cleanPath, appconstants.DirTemplates) {
cleanPath = appconstants.DirTemplates + cleanPath
}
_, err := embeddedTemplates.ReadFile(cleanPath)