Skip to content

Commit

Permalink
add format action on proto-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
logica0419 committed Aug 30, 2024
1 parent 8d69938 commit dbdb4d0
Showing 1 changed file with 37 additions and 5 deletions.
42 changes: 37 additions & 5 deletions .github/workflows/proto-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit dbdb4d0

Please sign in to comment.