Skip to content

Commit

Permalink
added action to automate script gen
Browse files Browse the repository at this point in the history
created an action that builds and gerated the completion script for ohmyzsh plugin using the inbuilt cobra engine
updated makefile so as to make it easier to interact with this action and generate the script
  • Loading branch information
tokamak-git committed Dec 18, 2023
1 parent 6d65ab1 commit 7c9d3c4
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/gen-completion.yml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7c9d3c4

Please sign in to comment.