-
Notifications
You must be signed in to change notification settings - Fork 0
feat(make): add workflow targets with fzf interactive prompts #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,7 @@ | ||||||||||||||||||||||||||||
| .PHONY: build clean rebuild test typecheck | ||||||||||||||||||||||||||||
| .PHONY: bench bench-search bench-init bench-concurrent | ||||||||||||||||||||||||||||
| .PHONY: release-tag release-push | ||||||||||||||||||||||||||||
| .PHONY: wf-release wf-publish wf-ci wf-list wf-watch | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # Build | ||||||||||||||||||||||||||||
| build: | ||||||||||||||||||||||||||||
|
|
@@ -37,3 +38,41 @@ release-tag: | |||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| release-push: | ||||||||||||||||||||||||||||
| git push --follow-tags | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # Workflows (requires gh cli + fzf) | ||||||||||||||||||||||||||||
| # Trigger release PR workflow with interactive prompts | ||||||||||||||||||||||||||||
| wf-release: | ||||||||||||||||||||||||||||
| @TYPE=$$(echo -e "auto\npatch\nminor\nmajor" | fzf --prompt="Version type: " --height=6 --reverse); \ | ||||||||||||||||||||||||||||
| if [ "$$TYPE" = "auto" ]; then \ | ||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the user cancels the |
||||||||||||||||||||||||||||
| read -p "Custom version (leave empty for auto): " VERSION; \ | ||||||||||||||||||||||||||||
| fi; \ | ||||||||||||||||||||||||||||
| echo "→ Triggering release: type=$$TYPE version=$${VERSION:-auto}"; \ | ||||||||||||||||||||||||||||
| gh workflow run release-pr.yml \ | ||||||||||||||||||||||||||||
| -f version_type=$$TYPE \ | ||||||||||||||||||||||||||||
| $${VERSION:+-f custom_version=$$VERSION}; \ | ||||||||||||||||||||||||||||
| sleep 2; \ | ||||||||||||||||||||||||||||
| $(MAKE) wf-watch W=release-pr.yml | ||||||||||||||||||||||||||||
|
Comment on lines
+53
to
+54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using a fixed |
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # Re-run failed publish workflow: make wf-publish [RUN=<run-id>] | ||||||||||||||||||||||||||||
| wf-publish: | ||||||||||||||||||||||||||||
| $(if $(RUN),\ | ||||||||||||||||||||||||||||
| gh run rerun $(RUN),\ | ||||||||||||||||||||||||||||
| gh run rerun --failed -w release-publish.yml) | ||||||||||||||||||||||||||||
| @sleep 2 | ||||||||||||||||||||||||||||
| @$(MAKE) wf-watch W=release-publish.yml | ||||||||||||||||||||||||||||
|
Comment on lines
+61
to
+62
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to other workflow-triggering targets, using a fixed |
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # Trigger CI workflow on current branch | ||||||||||||||||||||||||||||
| wf-ci: | ||||||||||||||||||||||||||||
| gh workflow run ci.yml --ref $(shell git branch --show-current) | ||||||||||||||||||||||||||||
|
Comment on lines
+64
to
+66
|
||||||||||||||||||||||||||||
| # Trigger CI workflow on current branch | |
| wf-ci: | |
| gh workflow run ci.yml --ref $(shell git branch --show-current) | |
| # Re-run CI workflow: make wf-ci [RUN=<run-id>] | |
| wf-ci: | |
| $(if $(RUN),\ | |
| gh run rerun $(RUN),\ | |
| gh run rerun --failed -w ci.yml) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The command will fail silently if no workflow runs exist (the jq query '.[0].databaseId' returns null for empty arrays). Add error handling to check if a run exists before calling gh run watch.
| $(if $(RUN),\ | |
| gh run watch $(RUN),\ | |
| gh run watch $(shell gh run list $(if $(W),-w $(W)) -L 1 --json databaseId -q '.[0].databaseId')) | |
| @if [ -n "$(RUN)" ]; then \ | |
| gh run watch $(RUN); \ | |
| else \ | |
| RUN_ID=$$(gh run list $(if $(W),-w $(W)) -L 1 --json databaseId -q '.[0].databaseId'); \ | |
| if [ -z "$$RUN_ID" ]; then \ | |
| echo "No workflow runs found to watch." >&2; \ | |
| exit 1; \ | |
| fi; \ | |
| gh run watch $$RUN_ID; \ | |
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing error handling if fzf is cancelled (Ctrl+C or ESC). When a user cancels fzf, TYPE will be empty and the workflow will still be triggered with an empty version type. Add a check after the fzf call to exit if TYPE is empty.