isPermissionErrorStr checks if a string contains any known permission/authentication error marker. This is the canonical union of all auth-error substrings used across the codebase; update here rather than adding new inline strings.Contains checks in callers. nolint:errstringmatch // gh auth and gh
(s string)
| 276 | // |
| 277 | //nolint:errstringmatch // gh auth and gh api permission failures are intentionally classified from gh CLI text here. |
| 278 | func isPermissionErrorStr(s string) bool { |
| 279 | return strings.Contains(s, "authentication required") || |
| 280 | strings.Contains(s, "exit status 4") || |
| 281 | strings.Contains(s, "GitHub CLI authentication") || |
| 282 | strings.Contains(s, "permission") || |
| 283 | strings.Contains(s, "GH_TOKEN") || |
| 284 | strings.Contains(s, "not logged into any GitHub hosts") || |
| 285 | strings.Contains(s, "To use GitHub CLI in a GitHub Actions workflow") || |
| 286 | strings.Contains(s, "gh auth login") |
| 287 | } |
| 288 | |
| 289 | // isPermissionError checks if an error is related to permissions/authentication. |
| 290 | func isPermissionError(err error) bool { |
no outgoing calls