feat(ci): auto go mod tidy examples (#561)

* feat(ci): auto go mod tidy examples

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: tutorials as well

* fix: checkout

---------

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Carlos Alexandro Becker 2023-02-23 13:51:15 -03:00 committed by GitHub
parent ae652b6a57
commit 32e3027ec1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 38 additions and 0 deletions

38
.github/workflows/examples.yml vendored Normal file
View File

@ -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