From dbdb4d0e04160e54ac93f08c6d83bf2e10141467 Mon Sep 17 00:00:00 2001 From: logica0419 <84759675+logica0419@users.noreply.github.com> Date: Sat, 31 Aug 2024 02:41:07 +0900 Subject: [PATCH] add format action on proto-ci --- .github/workflows/proto-ci.yaml | 42 +++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/.github/workflows/proto-ci.yaml b/.github/workflows/proto-ci.yaml index c82c13ce..57c73a4a 100644 --- a/.github/workflows/proto-ci.yaml +++ b/.github/workflows/proto-ci.yaml @@ -45,9 +45,46 @@ jobs: with: input: proto against: https://github.com/ictsc/ictsc-outlands.git#branch=main + format: + name: Format + runs-on: ubuntu-latest + defaults: + run: + working-directory: proto + steps: + - name: Generate a token + id: token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ secrets.PUSHER_APP_ID }} + private-key: ${{ secrets.PUSHER_PRIVATE_KEY }} + - name: Checkout + uses: actions/checkout@v4 + with: + token: ${{ steps.token.outputs.token }} + - name: Install buf + uses: bufbuild/buf-setup-action@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Run Format + run: | + buf format --write + - name: Push + id: push + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "run go mod tidy & format go codes" + branch: ${{ github.head_ref }} + commit_user_name: ictsc-actions[bot] + commit_user_email: 154957684+ictsc-actions[bot]@users.noreply.github.com + commit_author: ictsc-actions[bot] <154957684+ictsc-actions[bot]@users.noreply.github.com> + - name: Exit with Error If Files Are Changed + if: steps.push.outputs.changes_detected == 'true' + run: exit 1 generate: name: Generation runs-on: ubuntu-latest + needs: format steps: - name: Generate a token id: token @@ -59,11 +96,6 @@ jobs: uses: actions/checkout@v4 with: token: ${{ steps.token.outputs.token }} - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version-file: backend/go.mod - cache-dependency-path: backend/go.sum - name: Install buf uses: bufbuild/buf-setup-action@v1 with: