diff --git a/.github/workflows/gen-completion.yml b/.github/workflows/gen-completion.yml new file mode 100644 index 00000000000..7605050c695 --- /dev/null +++ b/.github/workflows/gen-completion.yml @@ -0,0 +1,31 @@ +name: Generate ohmyzsh completion +on: + pull_request: + paths: + - "**.go" + push: + branches: + - main + - release/v* + - "**.go" +jobs: + gen-completion-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - uses: actions/setup-go@v5 + with: + go-version: "1.20" + check-latest: true + - name: Generate completion file + run: make gen-completion + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + commit-message: Add ohmyzsh completion plugin + title: "chore: update ohmyzsh completion plugin" + body: > + This PR is auto-generated by + [create-pull-request](https://github.com/peter-evans/create-pull-request). + labels: automated pr diff --git a/Makefile b/Makefile index 9f2061be1f1..7027d06fe1f 100644 --- a/Makefile +++ b/Makefile @@ -309,3 +309,12 @@ proto-swagger-gen: @sh ./proto/scripts/protoc-swagger-gen.sh .PHONY: proto-gen proto-doc proto-swagger-gen + +############################################################################### +### Shell Completion Plugin ### +############################################################################### +gen-completion: build + @echo "Generating completion plugin for ohmyzsh" + ./build/gaiad completion > ./contrib/shell_completion/_gaiad + +.PHONY build