deploy,devtools: use golang:1.20 image

This will make pkgsite pick up the latest 1.20.x.
And
- reenable staticcheck.
- mark the working directory as safe when running for ci.
  (this workaround is needed after the security patch
   https://release.debian.org/proposed-updates/bullseye_diffs/git_2.30.2-1+deb11u1.debdiff)

Updates golang/go#53532

Change-Id: I31c5fc838821d8bd6ade81dc439eb46fabb75fe1
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/468917
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
diff --git a/all.bash b/all.bash
index 3f4b4fa..5c3f43c 100755
--- a/all.bash
+++ b/all.bash
@@ -148,9 +148,8 @@
 
 # check_staticcheck runs staticcheck on source files.
 check_staticcheck() {
- ensure_go_binary honnef.co/go/tools/cmd/staticcheck
-#  runcmd staticcheck $(go list ./... | grep -v third_party | grep -v internal/doc | grep -v internal/render)
-  echo "disabling staticcheck until go1.20 is supported"
+  ensure_go_binary honnef.co/go/tools/cmd/staticcheck
+  runcmd staticcheck $(go list ./... | grep -v third_party | grep -v internal/doc | grep -v internal/render)
 }
 
 # check_misspell runs misspell on source files.
@@ -318,6 +317,12 @@
       # permissions or that don't test the code.
       # Also, run the race detector on most tests.
       local start=`date +%s`
+
+      # Explicitly mark the working directory as safe in CI.
+      # https://github.com/docker-library/golang/issues/452
+      local wd=$(pwd)
+      runcmd git config --system --add safe.directory ${wd}
+
       standard_linters
       # Print how long it takes to download dependencies and run the standard
       # linters in CI.
diff --git a/deploy/deploy-env.yaml b/deploy/deploy-env.yaml
index dea84c2..3b0efd6 100644
--- a/deploy/deploy-env.yaml
+++ b/deploy/deploy-env.yaml
@@ -22,7 +22,7 @@
     args:
       - $PROJECT_ID
   - id: Check redistributable
-    name: golang:1.20rc3
+    name: golang:1.20
     entrypoint: private/devtools/check_redist.sh
   - id: Build
     name: gcr.io/cloud-builders/docker
@@ -48,7 +48,7 @@
       - -c
       - deploy/frontend.sh $_ENV gcr.io/$PROJECT_ID/frontend:$(cat _BUILD_TAG)
   - id: Pagecheck
-    name: golang:1.20rc3
+    name: golang:1.20
     entrypoint: deploy/pagecheck.sh
     args:
       - $_ENV
diff --git a/deploy/deploy.yaml b/deploy/deploy.yaml
index 8c50a48..f472317 100644
--- a/deploy/deploy.yaml
+++ b/deploy/deploy.yaml
@@ -22,7 +22,7 @@
     args:
       - $PROJECT_ID
   - id: Check redistributable
-    name: golang:1.20rc3
+    name: golang:1.20
     entrypoint: private/devtools/check_redist.sh
   - id: Build
     name: gcr.io/cloud-builders/docker
@@ -48,7 +48,7 @@
       - -c
       - deploy/frontend.sh staging gcr.io/$PROJECT_ID/frontend:$(cat _BUILD_TAG)
   - id: Pagecheck - staging
-    name: golang:1.20rc3
+    name: golang:1.20
     entrypoint:  deploy/pagecheck.sh
     args:
       - staging
@@ -77,7 +77,7 @@
       - -c
       - deploy/frontend.sh prod gcr.io/$PROJECT_ID/frontend:$(cat _BUILD_TAG)
   - id: Pagecheck - prod
-    name: golang:1.20rc3
+    name: golang:1.20
     entrypoint:  deploy/pagecheck.sh
     args:
       - prod
@@ -88,7 +88,7 @@
       - -c
       - deploy/frontend.sh beta gcr.io/$PROJECT_ID/frontend:$(cat _BUILD_TAG)
   - id: Pagecheck - beta
-    name: golang:1.20rc3
+    name: golang:1.20
     entrypoint:  deploy/pagecheck.sh
     args:
       - beta
diff --git a/deploy/migrate.yaml b/deploy/migrate.yaml
index cae0971..2c99496 100644
--- a/deploy/migrate.yaml
+++ b/deploy/migrate.yaml
@@ -16,7 +16,7 @@
     args:
       - $PROJECT_ID
   - id: Migrate
-    name: golang:1.20rc3
+    name: golang:1.20
     entrypoint: bash
     dir: private
     args:
diff --git a/deploy/sitemap.yaml b/deploy/sitemap.yaml
index 4eb31d8..09e185b 100644
--- a/deploy/sitemap.yaml
+++ b/deploy/sitemap.yaml
@@ -9,7 +9,7 @@
     args:
       - $PROJECT_ID
   - id: Build
-    name: golang:1.20rc3
+    name: golang:1.20
     entrypoint: bash
     dir: private
     args:
diff --git a/devtools/docker/compose.yaml b/devtools/docker/compose.yaml
index 727a8e3..7800a97 100644
--- a/devtools/docker/compose.yaml
+++ b/devtools/docker/compose.yaml
@@ -31,7 +31,7 @@
     depends_on:
       - db
      # This should match the version we are using on Cloud Run.
-    image: golang:1.20rc3
+    image: golang:1.20
     environment:
       <<: *database-variables
       <<: *go-variables
@@ -44,7 +44,7 @@
       - ../../:/pkgsite
     working_dir: /pkgsite
   searchtest:
-    image: golang:1.20rc3
+    image: golang:1.20
     depends_on:
       - frontend
     environment:
@@ -57,7 +57,7 @@
       - ../../:/pkgsite
     working_dir: /pkgsite
   api:
-    image: golang:1.20rc3
+    image: golang:1.20
     depends_on:
       - frontend
     environment:
@@ -70,7 +70,7 @@
     working_dir: /pkgsite
   frontend:
      # This should match the version we are using on AppEngine.
-    image: golang:1.20rc3
+    image: golang:1.20
     depends_on:
       - db
     command: bash -c "
@@ -89,7 +89,7 @@
     working_dir: /pkgsite
   seeddb:
      # This should match the version we are using on Cloud Run.
-    image: golang:1.20rc3
+    image: golang:1.20
     depends_on:
       - db
     # Note: technically we should check that migrations have completed before
@@ -142,7 +142,7 @@
     shm_size: 8G
   go:
      # This should match the version we are using on Cloud Run.
-    image: golang:1.20rc3
+    image: golang:1.20
     entrypoint: go
     environment:
       <<: *database-variables