cmd/gopherbot: address comments from CL 256179

This CL addresses post-merge comments from CL 256179.

Change-Id: I31f7d9cb521442a28697806380bf26b981d1062e
Reviewed-on: https://go-review.googlesource.com/c/build/+/256337
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
diff --git a/cmd/gopherbot/gopherbot.go b/cmd/gopherbot/gopherbot.go
index 6d05589..f552b35 100644
--- a/cmd/gopherbot/gopherbot.go
+++ b/cmd/gopherbot/gopherbot.go
@@ -942,7 +942,7 @@
 			return nil
 		}
 		return repo.ForeachIssue(func(gi *maintner.GitHubIssue) error {
-			if gi.Closed || gi.PullRequest || !isDocumentationTitle(gi.Title) || gi.HasLabel("Documentation") || gi.HasEvent("unlabeled") || strings.HasPrefix(gi.Title, "x/pkgsite:") {
+			if gi.Closed || gi.PullRequest || !isDocumentationTitle(gi.Title) || gi.HasLabel("Documentation") || gi.HasEvent("unlabeled") {
 				return nil
 			}
 			return b.addLabel(ctx, repo.ID(), gi, "Documentation")
@@ -977,8 +977,10 @@
 		}
 
 		repoID := b.gorepo.ID()
-		if err := b.removeLabels(ctx, repoID, gi, []string{"go.dev"}); err != nil {
-			return err
+		if gi.HasLabel("go.dev") {
+			if err := b.removeLabel(ctx, repoID, gi, "go.dev"); err != nil {
+				return err
+			}
 		}
 		return b.addLabel(ctx, repoID, gi, "pkgsite")
 	})
@@ -2260,6 +2262,10 @@
 		return false
 	}
 	t = strings.ToLower(t)
+	if strings.HasPrefix(t, "x/pkgsite:") {
+		// Don't label pkgsite issues with the Documentation label.
+		return false
+	}
 	if strings.HasPrefix(t, "doc:") {
 		return true
 	}