From 32e3027ec19e05e55c987aedd68fb306fab62fa3 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 23 Feb 2023 13:51:15 -0300 Subject: [PATCH] feat(ci): auto go mod tidy examples (#561) * feat(ci): auto go mod tidy examples Signed-off-by: Carlos A Becker * fix: tutorials as well * fix: checkout --------- Signed-off-by: Carlos A Becker --- .github/workflows/examples.yml | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/examples.yml diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml new file mode 100644 index 0000000..eed1bbc --- /dev/null +++ b/.github/workflows/examples.yml @@ -0,0 +1,38 @@ +name: examples + +on: + push: + branches: + - 'master' + paths: + - '.github/workflows/examples.yml' + - './examples/go.mod' + - './examples/go.sum' + - './tutorials/go.mod' + - './tutorials/go.sum' + - './go.mod' + - './go.sum' + workflow_dispatch: {} + +jobs: + tidy: + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: '^1' + cache: true + - shell: bash + run: | + (cd ./examples && go mod tidy) + (cd ./tutorials && go mod tidy) + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "chore: go mod tidy tutorials and examples" + branch: master + commit_user_name: actions-user + commit_user_email: actions@github.com +