From 8099adc40086b6a44fac2119163b6137554790c8 Mon Sep 17 00:00:00 2001 From: Mike Dame Date: Tue, 3 May 2022 15:59:52 +0000 Subject: [PATCH] Add workflow for make gotidy CI check --- .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