From d67d622569f7f4de6bfeb28ec0940c9e0b01b6e7 Mon Sep 17 00:00:00 2001 From: Mike Dame Date: Wed, 4 May 2022 15:37:01 -0400 Subject: [PATCH] Add workflow for make gotidy CI check (#9713) --- .github/workflows/gotidy.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/gotidy.yml diff --git a/.github/workflows/gotidy.yml b/.github/workflows/gotidy.yml new file mode 100644 index 000000000000..3a7ae761a132 --- /dev/null +++ b/.github/workflows/gotidy.yml @@ -0,0 +1,27 @@ +# This action requires that PRs run `make gotidy` to ensure +# dependencies are up to date in reaction to any changes + +name: gotidy + +on: + pull_request: + types: [opened, synchronize, reopened, labeled, unlabeled] + branches: + - main + +jobs: + gotidy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Check for go mod dependency changes + run: | + make gotidy + if [[ $(git diff --name-only | grep go\.mod) || $(git diff --name-only | grep go\.sum) ]] + then + echo "go.mod/go.sum deps changes detected." + echo "Please run `make gotidy`" + false + else + echo "No go module changes detected." + fi