mirror of
https://github.com/ivuorinen/gh-action-readme.git
synced 2026-01-26 03:04:10 +00:00
feat: update go version, renovate config, tooling, fixes (#28)
* feat(deps): update go version, renovate config, tooling * chore(deps): update google/go-github to v74 * feat(deps): migrate from yaml.v3 to goccy/go-yaml * chore(deps): update goccy/go-yaml to v1.18.0 and address security concerns * feat: improve issue templates and project configuration - Update GitHub issue templates with CLI-specific fields for better bug reports - Add specialized templates for documentation, theme, and performance issues - Update pre-commit config to include comprehensive documentation linting - Remove outdated Snyk configuration and security references - Update Go version from 1.23+ to 1.24+ across project - Streamline README.md organization and improve clarity - Update CHANGELOG.md and CLAUDE.md formatting - Create comprehensive CONTRIBUTING.md with development guidelines - Remove TODO.md (replaced by docs/roadmap.md) - Move SECURITY.md to docs/security.md * docs: fix markdown linting violations across documentation * fix: resolve template placeholder issues and improve uses statement generation * fix: remove trailing whitespace from GitHub issue template
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
"github.com/adrg/xdg"
|
||||
"github.com/gofri/go-github-ratelimit/github_ratelimit"
|
||||
"github.com/google/go-github/v57/github"
|
||||
"github.com/google/go-github/v74/github"
|
||||
"github.com/spf13/viper"
|
||||
"golang.org/x/oauth2"
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/google/go-github/v57/github"
|
||||
"github.com/google/go-github/v74/github"
|
||||
|
||||
"github.com/ivuorinen/gh-action-readme/internal/git"
|
||||
)
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/google/go-github/v57/github"
|
||||
"github.com/google/go-github/v74/github"
|
||||
|
||||
"github.com/ivuorinen/gh-action-readme/internal/cache"
|
||||
"github.com/ivuorinen/gh-action-readme/internal/git"
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"gopkg.in/yaml.v3"
|
||||
"github.com/goccy/go-yaml"
|
||||
)
|
||||
|
||||
// parseCompositeActionFromFile reads and parses a composite action file.
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/google/go-github/v57/github"
|
||||
"github.com/google/go-github/v74/github"
|
||||
"github.com/schollz/progressbar/v3"
|
||||
|
||||
"github.com/ivuorinen/gh-action-readme/internal/cache"
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"gopkg.in/yaml.v3"
|
||||
"github.com/goccy/go-yaml"
|
||||
)
|
||||
|
||||
// ActionYML models the action.yml metadata (fields are updateable as schema evolves).
|
||||
|
||||
@@ -2,11 +2,10 @@ package internal
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"github.com/google/go-github/v57/github"
|
||||
"github.com/google/go-github/v74/github"
|
||||
|
||||
"github.com/ivuorinen/gh-action-readme/internal/cache"
|
||||
"github.com/ivuorinen/gh-action-readme/internal/dependencies"
|
||||
@@ -18,6 +17,7 @@ import (
|
||||
const (
|
||||
defaultOrgPlaceholder = "your-org"
|
||||
defaultRepoPlaceholder = "your-repo"
|
||||
defaultUsesPlaceholder = "your-org/your-action@v1"
|
||||
)
|
||||
|
||||
// TemplateOptions defines options for rendering templates.
|
||||
@@ -92,14 +92,14 @@ func getGitRepo(data any) string {
|
||||
func getGitUsesString(data any) string {
|
||||
td, ok := data.(*TemplateData)
|
||||
if !ok {
|
||||
return "your-org/your-action@v1"
|
||||
return defaultUsesPlaceholder
|
||||
}
|
||||
|
||||
org := strings.TrimSpace(getGitOrg(data))
|
||||
repo := strings.TrimSpace(getGitRepo(data))
|
||||
|
||||
if !isValidOrgRepo(org, repo) {
|
||||
return "your-org/your-action@v1"
|
||||
return defaultUsesPlaceholder
|
||||
}
|
||||
|
||||
version := formatVersion(getActionVersion(data))
|
||||
@@ -127,14 +127,21 @@ func formatVersion(version string) string {
|
||||
|
||||
// buildUsesString constructs the uses string with optional action name.
|
||||
func buildUsesString(td *TemplateData, org, repo, version string) string {
|
||||
if td.Name != "" {
|
||||
// Use the validation package's FormatUsesStatement for consistency
|
||||
if org == "" || repo == "" {
|
||||
return defaultUsesPlaceholder
|
||||
}
|
||||
|
||||
// For actions within subdirectories, include the action name
|
||||
if td.Name != "" && repo != "" {
|
||||
actionName := validation.SanitizeActionName(td.Name)
|
||||
if actionName != "" && actionName != repo {
|
||||
return fmt.Sprintf("%s/%s/%s%s", org, repo, actionName, version)
|
||||
// Check if this looks like a subdirectory action
|
||||
return validation.FormatUsesStatement(org, repo+"/"+actionName, version)
|
||||
}
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%s/%s%s", org, repo, version)
|
||||
return validation.FormatUsesStatement(org, repo, version)
|
||||
}
|
||||
|
||||
// getActionVersion returns the action version from template data.
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"gopkg.in/yaml.v3"
|
||||
"github.com/goccy/go-yaml"
|
||||
|
||||
"github.com/ivuorinen/gh-action-readme/internal"
|
||||
"github.com/ivuorinen/gh-action-readme/internal/git"
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"gopkg.in/yaml.v3"
|
||||
"github.com/goccy/go-yaml"
|
||||
|
||||
"github.com/ivuorinen/gh-action-readme/internal"
|
||||
)
|
||||
@@ -94,8 +94,7 @@ func (e *ConfigExporter) exportYAML(config *internal.AppConfig, outputPath strin
|
||||
_ = file.Close() // File will be closed, error not actionable in defer
|
||||
}()
|
||||
|
||||
encoder := yaml.NewEncoder(file)
|
||||
encoder.SetIndent(2)
|
||||
encoder := yaml.NewEncoder(file, yaml.Indent(2))
|
||||
|
||||
// Add header comment
|
||||
_, _ = file.WriteString("# gh-action-readme configuration file\n")
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"gopkg.in/yaml.v3"
|
||||
"github.com/goccy/go-yaml"
|
||||
|
||||
"github.com/ivuorinen/gh-action-readme/internal"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user