build/cloudfns/sendwikidiff
Bryan C. Mills ecfecf7bea all: consistently set PWD to match Dir for subprocesses
Also consistently deduplicate Env entries, mainly to reduce confusion
when reading logs.

This change is probably larger than what is strictly needed to fix the
issue, but it seemed simpler than trying to figure out which of the
many calls to exec.Command in the module are actually relevant.
(It also provides some useful case studies for possible additions to
the Go standard library.)

For golang/go#33598

Change-Id: Ia2bce4549e4a71b56fb497e3df093f79fbcf7f29
Reviewed-on: https://go-review.googlesource.com/c/build/+/353549
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-10-08 15:15:56 +00:00
..
README.md cloudfns: fetch secrets from Secret Manager 2021-03-18 16:09:22 +00:00
go.mod cloudfns: update to go1.13 runtime 2020-04-28 20:27:02 +00:00
go.sum cloudfns: send email updates when the wiki changes 2019-01-29 20:39:59 +00:00
sendwikidiff.go all: consistently set PWD to match Dir for subprocesses 2021-10-08 15:15:56 +00:00
sendwikidiff_test.go cloudfns/sendwikidiff: fix test when git not available (like on windows longtest) 2019-12-12 17:46:51 +00:00

README.md

Go Reference

golang.org/x/build/cloudfns/sendwikidiff

Package sendwikidiff implements a Google Cloud background function that reacts to a pubsub message containing a GitHub webhook change payload.

Deploying

gcloud functions deploy HandleWikiChangePubSub \
  --project=symbolic-datum-552 \
  --runtime go113 \
  --trigger-topic github.webhooks.golang.go.wiki \
  --memory 1024 \
  --set-env-vars="SENDGRID_API_KEY=$(gcloud --project=symbolic-datum-552 secrets versions access latest --secret=sendgrid-sendonly-api-key)"