ci: add release workflow + install script #2
@@ -1,3 +1,6 @@
|
|||||||
|
# This composite action is designed for Gitea Actions runners.
|
||||||
|
# Gitea Actions supports GitHub Actions syntax including $GITHUB_OUTPUT,
|
||||||
|
# actions/cache, and actions/checkout.
|
||||||
name: 'AI Code Review'
|
name: 'AI Code Review'
|
||||||
description: 'Run AI-powered code review on a pull request using review-bot'
|
description: 'Run AI-powered code review on a pull request using review-bot'
|
||||||
|
|
||||||
|
|||||||
@@ -38,14 +38,15 @@ jobs:
|
|||||||
GITEA_URL="${{ github.server_url }}"
|
GITEA_URL="${{ github.server_url }}"
|
||||||
REPO="${{ github.repository }}"
|
REPO="${{ github.repository }}"
|
||||||
|
|
||||||
# Create release (parse ID without jq using grep/sed)
|
# Create release
|
||||||
RESPONSE=$(curl -sSf -X POST \
|
RESPONSE=$(curl -sSf -X POST \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
"${GITEA_URL}/api/v1/repos/${REPO}/releases" \
|
"${GITEA_URL}/api/v1/repos/${REPO}/releases" \
|
||||||
-d "{\"tag_name\": \"${VERSION}\", \"name\": \"${VERSION}\", \"body\": \"Release ${VERSION}\", \"draft\": false, \"prerelease\": false}")
|
-d "{\"tag_name\": \"${VERSION}\", \"name\": \"${VERSION}\", \"body\": \"Release ${VERSION}\", \"draft\": false, \"prerelease\": false}")
|
||||||
|
|
||||||
RELEASE_ID=$(echo "$RESPONSE" | sed -n 's/.*"id":\([0-9]*\).*/\1/p' | head -1)
|
# Parse release ID using Python (robust JSON parsing)
|
||||||
|
RELEASE_ID=$(echo "$RESPONSE" | python3 -c "import sys, json; print(json.load(sys.stdin)['id'])")
|
||||||
|
|
||||||
if [ -z "$RELEASE_ID" ]; then
|
if [ -z "$RELEASE_ID" ]; then
|
||||||
echo "Failed to create release" >&2
|
echo "Failed to create release" >&2
|
||||||
|
|||||||
@@ -56,6 +56,9 @@ llmTemp := flag.Float64("llm-temperature", envOrDefaultFloat("LLM_TEMPERATURE",
|
|||||||
// Initialize clients
|
// Initialize clients
|
||||||
giteaClient := gitea.NewClient(*giteaURL, *reviewerToken)
|
giteaClient := gitea.NewClient(*giteaURL, *reviewerToken)
|
||||||
llmClient := llm.NewClient(*llmBaseURL, *llmAPIKey, *llmModel)
|
llmClient := llm.NewClient(*llmBaseURL, *llmAPIKey, *llmModel)
|
||||||
|
if *llmTemp < 0 || *llmTemp > 2 {
|
||||||
|
log.Fatal("--llm-temperature must be between 0 and 2")
|
||||||
|
}
|
||||||
if *llmTemp > 0 {
|
if *llmTemp > 0 {
|
||||||
llmClient.WithTemperature(*llmTemp)
|
llmClient.WithTemperature(*llmTemp)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user