Compare commits

..

11 commits

Author SHA1 Message Date
6d10d1c8d6
fix(deps): update dependencies (major and minor)
Some checks failed
CI / Get Changed Files (pull_request) Successful in 16s
Setup Gitea Tea CLI / setup-and-login (pull_request) Successful in 24s
CI / Backend Tests (pull_request) Has been skipped
CI / Checkstyle Main (pull_request) Has been skipped
CI / Docker backend validation (pull_request) Has been skipped
CI / Docker frontend validation (pull_request) Failing after 38s
CI / eslint (pull_request) Successful in 27s
CI / oxlint (pull_request) Successful in 19s
CI / prettier (pull_request) Successful in 21s
CI / test-build (pull_request) Failing after 23s
2025-06-01 11:02:33 +00:00
1de660d0e2
Merge pull request 'fix: Fix claude to always use tea command to review' (!248) from claude/use-tea-cli into main
Reviewed-on: #248
Reviewed-by: Claude <claude@kjan.email>
2025-06-01 10:30:51 +00:00
5d5c27827b fix: Fix claude to always use tea command to review
All checks were successful
CI / Get Changed Files (pull_request) Successful in 8s
CI / eslint (pull_request) Successful in 30s
CI / oxlint (pull_request) Successful in 30s
CI / Docker frontend validation (pull_request) Successful in 32s
CI / prettier (pull_request) Successful in 41s
CI / Docker backend validation (pull_request) Successful in 16s
CI / test-build (pull_request) Successful in 1m6s
CI / Checkstyle Main (pull_request) Successful in 1m17s
CI / Backend Tests (pull_request) Successful in 1m54s
Setup Gitea Tea CLI / setup-and-login (pull_request) Successful in 1m18s
2025-06-01 12:24:42 +02:00
2b096695a3
Merge pull request 'fix: Fix claude pipeline' (!247) from claude/fix into main
Reviewed-on: #247
2025-06-01 10:20:54 +00:00
84a4ede026 fix: Fix claude pipeline
All checks were successful
CI / Get Changed Files (pull_request) Successful in 8s
CI / eslint (pull_request) Successful in 31s
CI / Docker frontend validation (pull_request) Successful in 29s
CI / oxlint (pull_request) Successful in 36s
CI / prettier (pull_request) Successful in 40s
CI / Docker backend validation (pull_request) Successful in 19s
CI / test-build (pull_request) Successful in 1m9s
Setup Gitea Tea CLI / setup-and-login (pull_request) Successful in 1m27s
CI / Checkstyle Main (pull_request) Successful in 1m19s
CI / Backend Tests (pull_request) Successful in 1m56s
2025-06-01 12:16:44 +02:00
f991e1d6ed
Merge pull request 'chore: Claude can respond in pr's' (!246) from claude/pr-response into main
Reviewed-on: #246
Reviewed-by: Claude <claude@kjan.email>
2025-06-01 10:14:13 +00:00
c719e43ba0 chore: Claude can respond in pr's
All checks were successful
CI / Get Changed Files (pull_request) Successful in 17s
Setup Gitea Tea CLI / setup-and-login (pull_request) Successful in 1m27s
CI / eslint (pull_request) Successful in 56s
CI / oxlint (pull_request) Successful in 38s
CI / prettier (pull_request) Successful in 50s
CI / test-build (pull_request) Successful in 1m40s
CI / Docker frontend validation (pull_request) Successful in 20s
CI / Docker backend validation (pull_request) Successful in 17s
CI / Checkstyle Main (pull_request) Successful in 1m26s
CI / Backend Tests (pull_request) Successful in 2m58s
2025-06-01 12:08:02 +02:00
5ca152007e Merge branch 'main' into claude/pr-response 2025-06-01 12:06:50 +02:00
bb1621ba49
Merge pull request 'fix: Fix frontend build bc apparently they changed the node version' (!245) from fix/node-version into main
All checks were successful
Release / Release (push) Successful in 2m6s
Release / Build Backend Image (push) Successful in 59s
Release / Build Frontend Image (push) Successful in 47s
Reviewed-on: #245
2025-06-01 10:03:18 +00:00
602166aa61 fix: Remove sudo
All checks were successful
CI / Get Changed Files (pull_request) Successful in 9s
CI / oxlint (pull_request) Successful in 22s
CI / eslint (pull_request) Successful in 32s
CI / Docker frontend validation (pull_request) Successful in 30s
CI / prettier (pull_request) Successful in 35s
CI / Docker backend validation (pull_request) Successful in 16s
CI / test-build (pull_request) Successful in 1m7s
CI / Checkstyle Main (pull_request) Successful in 1m15s
CI / Backend Tests (pull_request) Successful in 1m53s
Setup Gitea Tea CLI / setup-and-login (pull_request) Successful in 1m17s
2025-06-01 11:09:12 +02:00
749303c3ee fix: Fix frontend build bc apparently they changed the node version 2025-06-01 11:09:07 +02:00
3 changed files with 118 additions and 2 deletions

View file

@ -0,0 +1,111 @@
name: Claude Gitea PR Interaction via Comment
on:
issue_comment:
types: [created]
jobs:
claude-interact-on-comment:
runs-on: ubuntu-latest
if: |
github.event.issue.pull_request &&
contains(github.event.comment.body, '@Claude')
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for git diff against main/master
- name: Set Tea Version
id: tea_version
run: echo "version=0.9.2" >> $GITHUB_OUTPUT # Check for the latest stable version
- name: Download Tea CLI
run: |
TEA_VERSION=$(echo "${{ steps.tea_version.outputs.version }}")
wget "https://gitea.com/gitea/tea/releases/download/v${TEA_VERSION}/tea-${TEA_VERSION}-linux-amd64" -O tea
chmod +x tea
sudo mv tea /usr/local/bin/tea
- name: Verify Tea Installation
run: tea --version
- name: Add Gitea Login
env:
GITEA_URL: ${{ secrets._GITEA_URL }}
GITEA_TOKEN: ${{ secrets._GITEA_TOKEN }}
run: |
if [ -z "$GITEA_URL" ]; then
echo "Error: GITEA_URL secret is not set."
exit 1
fi
if [ -z "$GITEA_TOKEN" ]; then
echo "Error: GITEA_TOKEN secret is not set."
exit 1
fi
INSECURE_FLAG=""
if [[ "${GITEA_URL}" == http://* ]]; then
INSECURE_FLAG="--insecure"
fi
tea login add --name mygitea --url "$GITEA_URL" --token "$GITEA_TOKEN" $INSECURE_FLAG
- name: Install bun
uses: oven-sh/setup-bun@v2
- name: Install claude-code
run: bun i -g @anthropic-ai/claude-code
- name: Claude Process PR Comment
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
PR_NUMBER: ${{ github.event.issue.number }}
COMMENT_BODY: ${{ github.event.comment.body }}
COMMENT_AUTHOR: ${{ github.event.comment.user.login }}
GITEA_URL: ${{ secrets._GITEA_URL }}
run: |
claude --allowedTools "Bash(tea:*)" --allowedTools "Bash(git:*)" --allowedTools "Read" --allowedTools "Grep" --allowedTools "WebFetch" --allowedTools "Glob" --allowedTools "LS" -p "You are an AI assistant integrated with Gitea (at ${GITEA_URL}) via the 'tea' CLI.
You have been invoked because user '${COMMENT_AUTHOR}' left the following comment on Pull Request #${PR_NUMBER}:
---
${COMMENT_BODY}
---
Your primary task is to:
1. Carefully understand the user's request within their comment.
2. Use the 'tea' CLI to perform the requested action(s) on Pull Request #${PR_NUMBER}.
3. If the request is to review the PR, fetch the diff against the PR's base branch (e.g., 'git fetch origin main && git diff origin/main...HEAD' or similar; adapt branch name if necessary, or use 'tea pr diff ${PR_NUMBER}') and provide constructive feedback.
4. For other actions, translate the user's intent into the appropriate 'tea' command.
**How to Post Reviews and Other Feedback:**
- When you provide a review, post it as a comment using:
\`tea pr comment ${PR_NUMBER} -m \"Claude's Review:\n[Your detailed review, mentioning files and line numbers.]\"\`
- For other informational responses or clarifications, also use \`tea pr comment ...\`.
**Critical: Handling Approval, Rejection, or Merge Requests:**
Pull Request approval, rejection, and merging are critical actions and should not be used to 'cheat' the review process. You cannot verify Gitea user permissions.
- If a user comments asking you to directly approve (e.g., '@claude approve this'), merge, or reject a PR:
1. **Do NOT blindly execute these commands.**
2. **Approval/Merge:**
- State in a comment (using \`tea pr comment ...\`) that direct approval/merge requests via you are typically for convenience after a proper human review process has been implicitly completed or if the requester is a designated maintainer explicitly overriding.
- If the PR has not been reviewed by you yet, and the comment implies a review is also needed, perform the review FIRST and post it.
- You should only consider proceeding with a \`tea pr approve ${PR_NUMBER}\` or \`tea pr merge ${PR_NUMBER}\` command if:
a. The comment explicitly states that all necessary human reviews are complete and this is just a formal step by a trusted user.
b. OR, your own comprehensive review found no critical issues and the request seems appropriate in context.
- If in doubt, default to posting your review (if applicable) and stating that a maintainer should perform the final approval/merge. Your goal is to assist, not to bypass established review procedures.
3. **Rejection/Requesting Changes:**
- If asked to reject or request changes, you should typically base this on your own review of the PR's changes.
- First, perform a review if you haven't already.
- Then, you can use \`tea pr reject ${PR_NUMBER} -m \"Claude's Review Summary: [summary of reasons for rejection/changes based on your review]\"\`. Ensure your detailed review is also available as a comment.
Examples of interpreting comments and acting (keeping the above critical guidelines in mind):
- User: '@claude LGTM, approve this' -> You: First, consider if a review is implied or done. If so, and you agree, you might approve. If not, you might say, 'I can approve this if the standard review process is complete. Have maintainers reviewed this?' or perform your own review.
- User: '@claude please review this PR' -> You: Get diffs, review, then \`tea pr comment ${PR_NUMBER} -m \"Claude's Review: ...\"\`.
- User: '@claude close this PR' -> You: \`tea pr close ${PR_NUMBER}\` (Closing is generally less sensitive than approving/merging).
- User: '@claude add label enhancement' -> You: \`tea pr label ${PR_NUMBER} --add enhancement\`
IMPORTANT GUIDELINES:
- You MUST use the 'tea' CLI for all Gitea interactions.
- You MUST use the tea cli to comment on the PR so the user gets a response.
- For PR reviews, ALWAYS analyze the diff. Make sure to mention specific files and line numbers.
- Be precise with 'tea' commands. If ambiguous, ask for clarification using \`tea pr comment ...\`.
- Ensure reviews are professional, constructive, and helpful.
"

View file

@ -31,7 +31,7 @@ jobs:
TEA_VERSION=$(echo "${{ steps.tea_version.outputs.version }}")
wget "https://gitea.com/gitea/tea/releases/download/v${TEA_VERSION}/tea-${TEA_VERSION}-linux-amd64" -O tea
chmod +x tea
sudo mv tea /usr/local/bin/tea
mv tea /usr/local/bin/tea
- name: Verify Tea Installation
run: tea --version

View file

@ -1,7 +1,12 @@
FROM oven/bun:debian AS build
WORKDIR /app
RUN apt-get update -y && apt-get install nodejs -y
RUN apt-get update -y && \
apt-get install -y --no-install-recommends curl ca-certificates gnupg && \
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y --no-install-recommends nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ENV NODE_ENV=production