mirror of
https://github.com/tailscale/tailscale.git
synced 2025-02-18 10:58:39 +00:00
![Josh Bleecher Snyder](/assets/img/avatar_default.png)
We don't want to force ourselves to update the DERP list every time we want to cut a new release. Having an outdated DERP list on release branches is OK. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
42 lines
964 B
YAML
42 lines
964 B
YAML
name: go generate
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- "release-branch/*"
|
|
pull_request:
|
|
branches:
|
|
- "*"
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v1
|
|
with:
|
|
go-version: 1.17
|
|
|
|
- name: Check out code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: check 'go generate' is clean
|
|
run: |
|
|
mkdir gentools
|
|
go build -o gentools/stringer golang.org/x/tools/cmd/stringer
|
|
if [[ "${{github.ref}}" == release-branch/* ]]
|
|
then
|
|
pkgs=$(go list ./... | grep -v dnsfallback)
|
|
else
|
|
pkgs=$(go list ./...)
|
|
fi
|
|
echo pkgs: $pkgs
|
|
PATH="$PATH:$(pwd)/gentools" go generate $pkgs
|
|
echo
|
|
echo
|
|
git diff --name-only --exit-code || (echo "The files above need updating. Please run 'go generate'."; exit 1)
|