From 4f90cdca3cb4b2193f138c3cb64bbf00eef902a0 Mon Sep 17 00:00:00 2001 From: Yuxiang Cao Date: Fri, 26 Apr 2024 15:22:12 -0700 Subject: [PATCH] ci: add fmt lint - Add GitHub Action for formatting code though autofix-ci/action. --- .github/workflows/build.yml | 2 +- .github/workflows/lint-review.yaml | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/lint-review.yaml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5a453cf..04895cd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '1.18' + go-version-file: go.mod cache-dependency-path: go.sum - name: Build diff --git a/.github/workflows/lint-review.yaml b/.github/workflows/lint-review.yaml new file mode 100644 index 0000000..bccddef --- /dev/null +++ b/.github/workflows/lint-review.yaml @@ -0,0 +1,25 @@ +name: autofix.ci + +on: + pull_request: + branches: + - master + +permissions: + contents: read + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version-file: "go.mod" + + - run: gofmt -w -s . + + - uses: autofix-ci/action@ea32e3a12414e6d3183163c3424a7d7a8631ad84