You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[MAINT]: Detect not-found via the error (errors.AsType) in github_team_repository delete #3523
While reviewing #3518 (a fix for a nil-pointer panic in resourceGithubTeamRepositoryDelete), @stevehipwell noted that the delete function's error handling should be reworked:
the error handling in this function isn't correctly implemented and there also appears to be unnecessary complexity. This whole block needs updating to check for an error and then use errors.AsType to check for a GitHub error with a response.
This tracks that follow-up. resourceGithubTeamRepositoryDelete currently detects the not-found case by reading resp.StatusCode off the raw HTTP *github.Response. It should instead inspect the returned error via errors.AsType[*github.ErrorResponse](err), matching the resource's own Read function and the pattern already used across the provider (for example resource_github_issue_label.go and util_retry.go).
Keying off the error rather than the response:
removes the need to nil-check the response (a transport error yields a nil *github.Response), and
aligns with the errorlint linter that is enabled for this repository.
The repository-rename recovery and archived-repository handling should be preserved.
This repo is maintained by GitHub and community members on a best-effort basis. We'll get to this as soon as we can.
You can help us prioritize by adding details, reproduction steps, or a 👍 to issues that matter to you, and by joining the discussion on open issues and PRs.
Activity
github-actions commentedon Jul 6, 2026
👋 Hi, and thank you for opening this issue!
This repo is maintained by GitHub and community members on a best-effort basis. We'll get to this as soon as we can.
You can help us prioritize by adding details, reproduction steps, or a 👍 to issues that matter to you, and by joining the discussion on open issues and PRs.
🤖 This is an automated message.