From 2adacbc03842a15a92c662a19063eea770eda952 Mon Sep 17 00:00:00 2001 From: Andy Hsu Date: Thu, 3 Aug 2023 14:37:53 +0800 Subject: [PATCH] ci: auto gofmt for pull request [skip ci] --- .github/workflows/pr_auto_gofmt.yml | 19 +++++++++++++++++++ .gitignore | 2 ++ 2 files changed, 21 insertions(+) create mode 100644 .github/workflows/pr_auto_gofmt.yml diff --git a/.github/workflows/pr_auto_gofmt.yml b/.github/workflows/pr_auto_gofmt.yml new file mode 100644 index 000000000000..5ccc63ae538c --- /dev/null +++ b/.github/workflows/pr_auto_gofmt.yml @@ -0,0 +1,19 @@ +name: Golang Formatter +on: [pull_request] +jobs: + prettier: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + # Make sure the actual branch is checked out when running on pull requests + ref: ${{ github.head_ref }} + # This is important to fetch the changes to the previous commit + fetch-depth: 0 + + - name: Format code + uses: iamnotaturtle/auto-gofmt@v2 + with: + commit_message: "style: format code with gofmt" + only_changed: True \ No newline at end of file diff --git a/.gitignore b/.gitignore index a21da6245c9d..9f5ade897ca4 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,5 @@ output/ /daemon/ /public/dist/* /!public/dist/README.md + +.VSCodeCounter \ No newline at end of file