From 3b8e2d0d8c887000a6d06d581976a8e5b6f9a817 Mon Sep 17 00:00:00 2001 From: Hao Chen Date: Tue, 13 Sep 2022 13:00:25 +0800 Subject: [PATCH 1/3] add json schema update github action --- .github/workflows/schema.yaml | 31 +++++++++++++++++++++++++++++++ .gitignore | 3 ++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/schema.yaml diff --git a/.github/workflows/schema.yaml b/.github/workflows/schema.yaml new file mode 100644 index 00000000..9a71dc5a --- /dev/null +++ b/.github/workflows/schema.yaml @@ -0,0 +1,31 @@ +name: JSON Schema + +on: + push: + branches: + - main + paths: + - "**/*.go" + - ".github/workflows/schema.yaml" + +jobs: + schema: + name: JSON Schema + runs-on: ubuntu-latest + steps: + - name: Checkout Source Code + uses: actions/checkout@v3 + + - name: Build EaseProbe + run: make + + - name: Generate JSON Schema + run: ./build/bin/easeprobe -j > resources/schema.json + + - name: Commit JSON Schema + uses: EndBug/add-and-commit@v7 + with: + message: "Update JSON Schema" + add: "resources/schema.json" + author_name: "GitHub Actions" + author_email: "actions@github.com" \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1488b2b6..40af2409 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea/ .vscode/ build/* -*.yaml \ No newline at end of file +*.yaml +!.github/workflows/*.yaml \ No newline at end of file From 2a66bb18f6ecd77ac8dfd9ea0625d540ce1abf75 Mon Sep 17 00:00:00 2001 From: Hao Chen Date: Tue, 13 Sep 2022 13:05:35 +0800 Subject: [PATCH 2/3] add a step to set the golang compile env --- .github/workflows/schema.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/schema.yaml b/.github/workflows/schema.yaml index 9a71dc5a..dcb57e2e 100644 --- a/.github/workflows/schema.yaml +++ b/.github/workflows/schema.yaml @@ -8,6 +8,9 @@ on: - "**/*.go" - ".github/workflows/schema.yaml" +env: + GO_VERSION: 1.18 + jobs: schema: name: JSON Schema @@ -16,6 +19,11 @@ jobs: - name: Checkout Source Code uses: actions/checkout@v3 + - name: Setup Go Environment + uses: actions/setup-go@v3 + with: + go-version: ${{ env.GO_VERSION }} + - name: Build EaseProbe run: make From bd33c2c6f23ff0b6b501eafd6a8910f7251dc735 Mon Sep 17 00:00:00 2001 From: Hao Chen Date: Tue, 13 Sep 2022 14:14:17 +0800 Subject: [PATCH 3/3] add MegaEasebot to solve the branch protection problem --- .github/workflows/schema.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/schema.yaml b/.github/workflows/schema.yaml index dcb57e2e..e20ecca2 100644 --- a/.github/workflows/schema.yaml +++ b/.github/workflows/schema.yaml @@ -18,6 +18,8 @@ jobs: steps: - name: Checkout Source Code uses: actions/checkout@v3 + with: + token: ${{ secrets.MEGAEASE_BOT }} - name: Setup Go Environment uses: actions/setup-go@v3