diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 857804b..4f7547a 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -11,7 +11,7 @@ permissions: jobs: release: name: Create Release - runs-on: ubuntu-latest + runs-on: ubuntu-gitea steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/cmd/edit.go b/cmd/edit.go index 1ebedff..69df99b 100644 --- a/cmd/edit.go +++ b/cmd/edit.go @@ -71,7 +71,11 @@ var editCmd = &cobra.Command{ fmt.Print("\n\nApply these changes? (y/n): ") var confirm string - fmt.Scanln(&confirm) + if _, err := fmt.Scanln(&confirm); err != nil { + color.Red("Failed to read input: %v", err) + color.Yellow("Changes discarded. Backup saved as %s", backupPath) + return + } if confirm != "y" && confirm != "Y" { color.Yellow("Changes discarded. Backup saved as %s", backupPath) return diff --git a/cmd/lint.go b/cmd/lint.go index 4f4b434..322aec5 100644 --- a/cmd/lint.go +++ b/cmd/lint.go @@ -165,7 +165,11 @@ func runLint(cmd *cobra.Command, args []string) { // Ask for confirmation color.Yellow("Apply these fixes? (y/N): ") var response string - fmt.Scanln(&response) + if _, err := fmt.Scanln(&response); err != nil { + logger.Info("failed to read user input", "file", absPath, "error", err) + color.Yellow("❌ Cancelled. Backup preserved at: %s", backupPath) + return + } response = strings.ToLower(strings.TrimSpace(response)) if response != "y" && response != "yes" {