From 52eb7655b1145d69b33aa6ecb6f8ffc5aabd2977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Sun, 28 Mar 2021 13:25:41 +0100 Subject: [PATCH] chore(ci): run go mod tidy on merges --- .github/workflows/go-mod-tidy.yml | 46 +++++++++++++++++++++++++++++++ .github/workflows/test.yml | 28 ------------------- 2 files changed, 46 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/go-mod-tidy.yml diff --git a/.github/workflows/go-mod-tidy.yml b/.github/workflows/go-mod-tidy.yml new file mode 100644 index 000000000..13f004cbb --- /dev/null +++ b/.github/workflows/go-mod-tidy.yml @@ -0,0 +1,46 @@ +name: Go mod tidy + +on: + push: + branches: + - main + paths: + - go.mod + - go.sum + - tools/*/go.mod + - tools/*/go.sum + +jobs: + version-sync: + name: Run go mod tidy + runs-on: ubuntu-20.04 + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.16.2 + + - name: Run go mod tidy + run: | + go mod tidy + make tools-go-mod-tidy + + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v3.8.2 + with: + token: ${{ secrets.GH_REPO_TOKEN }} + author: "Ɓukasz Mierzwa " + commit-message: "fix(deps): run go mod tidy" + branch: go-mod-tidy + delete-branch: true + title: "fix(deps): run go mod tidy" + labels: automerge + + - name: Check outputs + run: | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 959b64bb5..6b9297ce6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -215,33 +215,6 @@ jobs: - name: Check for local changes run: git diff --exit-code - go-mod-tidy: - name: Verify go.sum - runs-on: ubuntu-20.04 - steps: - - name: Check out code - uses: actions/checkout@v2 - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.16.2 - - - name: Mock web assets - run: make mock-assets - - - name: Fetch code - run: go get -d -v ./cmd/karma - - - name: Run go mod tidy - run: go mod tidy - - - name: Tidy tools - run: make tools-go-mod-tidy - - - name: Check for local changes - run: git diff --exit-code - deps-js: name: Check JS dependencies runs-on: ubuntu-20.04 @@ -329,7 +302,6 @@ jobs: - lint-js - format-go - format-js - - go-mod-tidy - deps-js - lint-versions - typescript