Files
claude-code-action/.forgejo/workflows/claude.yml
T
Vlad MocanuandClaude Opus 4.6 414c7053eb fix: let all issues events through workflow gate on Forgejo
Forgejo does not populate github.event.action in the workflow if:
context for issues events (run 12061 was skipped despite action
being 'labeled'). Same pattern as pull_request_comment (M3).

Remove the action/body/title gating from the workflow condition
and let trigger.ts handle all validation (label, assignee, mention).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 10:19:39 +02:00

75 lines
2.6 KiB
YAML

name: Claude Code (Forgejo)
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned, labeled]
pull_request_review:
types: [submitted]
concurrency:
group: claude-${{ github.event.issue.number || github.event.pull_request.number }}-${{ github.run_id }}
jobs:
claude:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' || github.event_name == 'pull_request_comment') ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
# Forgejo does not populate github.event.action in the workflow if: context for
# issues events (run 12061 was skipped despite action being 'labeled'). Let all
# issues events through — trigger.ts validates label/assignee/mention checks.
(github.event_name == 'issues')
runs-on: grunt
steps:
- name: Checkout
uses: https://${{ secrets.READ_REPO_TOKEN }}@git.wxs.ro/xternal/checkout@v6.0.2
with:
fetch-depth: 1
- name: Run Claude Code
id: claude
uses: ./
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.CLAUDE_BOT_TOKEN }}
bot_id: "48"
bot_name: "claude"
bot_email: "claude@wxs.ro"
platform: "forgejo"
assignee_trigger: "claude"
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
- name: Debug on failure
if: failure()
run: |
echo "=== Debug Info ==="
echo "Platform: PLATFORM=$PLATFORM FORGEJO=$FORGEJO"
echo "Server URL: $GITHUB_SERVER_URL"
echo "API URL: $GITHUB_API_URL"
echo "Event: ${{ github.event_name }} / ${{ github.event.action }}"
echo "Actor: ${{ github.actor }}"
echo ""
echo "=== Event Payload ==="
echo "comment.body: ${{ github.event.comment.body }}"
echo "comment.id: ${{ github.event.comment.id }}"
echo "review.body: ${{ github.event.review.body }}"
echo "review.id: ${{ github.event.review.id }}"
echo ""
if [ -f "$GITHUB_EVENT_PATH" ]; then
echo "--- GITHUB_EVENT_PATH ---"
cat "$GITHUB_EVENT_PATH"
fi
echo ""
EXEC_FILE="${{ steps.claude.outputs.execution_file }}"
if [ -f "$EXEC_FILE" ]; then
echo "--- Execution file contents ---"
cat "$EXEC_FILE"
else
echo "No execution file found"
fi