✨ feat: enhance commit message skill with issue reference suggestions (related to #2)
Some checks failed
Go CI/CD Pipeline / Build and Test (push) Successful in 4m26s
Docker Build and Publish / Version Bump (push) Successful in 10m6s
Go CI/CD Pipeline / Lint and Format (push) Successful in 10m33s
Go CI/CD Pipeline / Version Management (push) Successful in 25s
Main Branch CI/CD (Optimized) / Build and Test (push) Failing after 4m2s
Main Branch CI/CD (Optimized) / Lint and Format (push) Successful in 4m41s
Main Branch CI/CD (Optimized) / Version Management and Docker Build (push) Has been skipped
Docker Build and Publish / Build and Push Docker Image (push) Failing after 5m1s
Some checks failed
Go CI/CD Pipeline / Build and Test (push) Successful in 4m26s
Docker Build and Publish / Version Bump (push) Successful in 10m6s
Go CI/CD Pipeline / Lint and Format (push) Successful in 10m33s
Go CI/CD Pipeline / Version Management (push) Successful in 25s
Main Branch CI/CD (Optimized) / Build and Test (push) Failing after 4m2s
Main Branch CI/CD (Optimized) / Lint and Format (push) Successful in 4m41s
Main Branch CI/CD (Optimized) / Version Management and Docker Build (push) Has been skipped
Docker Build and Publish / Build and Push Docker Image (push) Failing after 5m1s
This commit is contained in:
@@ -234,6 +234,10 @@ main() {
|
||||
wait-job) cmd_wait_job "$@" ;;
|
||||
comment-pr) cmd_comment_pr "$@" ;;
|
||||
pr-status) cmd_pr_status "$@" ;;
|
||||
list-issues) cmd_list_issues "$@" ;;
|
||||
create-issue) cmd_create_issue "$@" ;;
|
||||
show-issue) cmd_show_issue "$@" ;;
|
||||
comment-issue) cmd_comment_issue "$@" ;;
|
||||
*)
|
||||
echo "Usage: $0 <command> [args...]" >&2
|
||||
echo "" >&2
|
||||
@@ -246,9 +250,84 @@ main() {
|
||||
echo " wait-job <owner> <repo> <job_id> [timeout]" >&2
|
||||
echo " comment-pr <owner> <repo> <pr_number> <comment>" >&2
|
||||
echo " pr-status <owner> <repo> <pr_number>" >&2
|
||||
echo " list-issues <owner> <repo> [state]" >&2
|
||||
echo " create-issue <owner> <repo> <title> <description>" >&2
|
||||
echo " show-issue <owner> <repo> <issue_number>" >&2
|
||||
echo " comment-issue <owner> <repo> <issue_number> <comment>" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# List issues
|
||||
cmd_list_issues() {
|
||||
local owner="$1"
|
||||
local repo="$2"
|
||||
local state="${3:-open}"
|
||||
|
||||
if [[ -z "$owner" || -z "$repo" ]]; then
|
||||
echo "Usage: $0 list-issues <owner> <repo> [state]" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local endpoint="/repos/$owner/$repo/issues?state=$state"
|
||||
api_request "GET" "$endpoint"
|
||||
}
|
||||
|
||||
# Create a new issue
|
||||
cmd_create_issue() {
|
||||
local owner="$1"
|
||||
local repo="$2"
|
||||
local title="$3"
|
||||
local description="$4"
|
||||
|
||||
if [[ -z "$owner" || -z "$repo" || -z "$title" || -z "$description" ]]; then
|
||||
echo "Usage: $0 create-issue <owner> <repo> <title> <description>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local endpoint="/repos/$owner/$repo/issues"
|
||||
local data=$(jq -n --arg title "$title" --arg body "$description" '{
|
||||
title: $title,
|
||||
body: $body
|
||||
}')
|
||||
|
||||
api_request "POST" "$endpoint" "$data"
|
||||
}
|
||||
|
||||
# Show issue details
|
||||
cmd_show_issue() {
|
||||
local owner="$1"
|
||||
local repo="$2"
|
||||
local issue_number="$3"
|
||||
|
||||
if [[ -z "$owner" || -z "$repo" || -z "$issue_number" ]]; then
|
||||
echo "Usage: $0 show-issue <owner> <repo> <issue_number>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local endpoint="/repos/$owner/$repo/issues/$issue_number"
|
||||
api_request "GET" "$endpoint"
|
||||
}
|
||||
|
||||
# Comment on an issue
|
||||
cmd_comment_issue() {
|
||||
local owner="$1"
|
||||
local repo="$2"
|
||||
local issue_number="$3"
|
||||
local comment="$4"
|
||||
|
||||
if [[ -z "$owner" || -z "$repo" || -z "$issue_number" || -z "$comment" ]]; then
|
||||
echo "Usage: $0 comment-issue <owner> <repo> <issue_number> <comment>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local endpoint="/repos/$owner/$repo/issues/$issue_number/comments"
|
||||
local data=$(jq -n --arg body "$comment" '{
|
||||
body: $body
|
||||
}')
|
||||
|
||||
api_request "POST" "$endpoint" "$data"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
Reference in New Issue
Block a user