Skip to content

Commit

Permalink
added logger-swagger generate action
Browse files Browse the repository at this point in the history
  • Loading branch information
Dtsnko committed Aug 8, 2024
1 parent 76ad5b5 commit a520287
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/logger-swagger-generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
on:
push:
paths:
- logger/**

jobs:
swagger-mix:
runs-on: ubuntu-latest
name: Run protoc gen-swagger compiler on logger
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Install protoc
run: sudo apt-get install -y protobuf-compiler
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.22
- name: Instal protoc-gen-swagger
run: go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger@latest
- name: Run compiler
run: protoc -I./annotations -I./general/general.proto -I./logger -I. --swagger_out=version=false,json_names_for_fields=false,allow_delete_body=true,include_package_in_tags=false,allow_repeated_fields_in_body=false,fqn_for_swagger_name=false,merge_file_name=logger,allow_merge=true:./swagger ./logger/*.proto
- name: Run swagger-mix
run: go run github.com/msample/swagger-mixin@latest swagger/engine.swagger.json swagger/storage.swagger.json swagger/messages.swagger.json swagger/logger.swagger.json swagger/contacts.swagger.json swagger/webitel-go.swagger.json swagger/wfm.swagger.json > swagger/api.json
- name: Push changes
if: always()
run: |
git add swagger/api.json
git add swagger/logger.swagger.json
git config --global user.name 'webitel-bot'
git config --global user.email '[email protected]'
git commit -am "Automated logger.swagger.json generation"
git push

0 comments on commit a520287

Please sign in to comment.