Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions .github/workflows/ai-devel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Claude Code

on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]

jobs:
claude:
if: |
(github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'COLLABORATOR') &&
(
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
)
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
actions: read # Required for Claude to read CI results on PRs
steps:
- name: Get PR Info
id: pr_info
run: |
if PR_DATA=$(gh pr view $ISSUE_NUMBER --repo ${{ github.repository }} --json headRefName,headRepository,author,isCrossRepository 2>/dev/null); then
HEAD_REF_NAME=$(echo "$PR_DATA" | jq -r .headRefName)
IS_FORK=$(echo "$PR_DATA" | jq -r .isCrossRepository)
if [ "$IS_FORK" = "true" ]; then
echo "This is a FORKED PR. Manually constructing repository name."
REPO_NAME=$(echo "$PR_DATA" | jq -r .headRepository.name)
AUTHOR_LOGIN=$(echo "$PR_DATA" | jq -r .author.login)
HEAD_REPOSITORY="$AUTHOR_LOGIN/$REPO_NAME"
else
echo "This is an INTERNAL PR. Using the current repository name."
HEAD_REPOSITORY="${{ github.repository }}"
fi
echo "Final Repository Name: $HEAD_REPOSITORY"
echo "Final Branch Name: $HEAD_REF_NAME"
echo "repo_full_name=$HEAD_REPOSITORY" >> $GITHUB_OUTPUT
echo "branch_name=$HEAD_REF_NAME" >> $GITHUB_OUTPUT
else
echo "Final Repository Name: ${{ github.repository }}"
echo "Final Branch Name: ${{ github.event.repository.default_branch }}"
echo "repo_full_name=${{ github.repository }}" >> $GITHUB_OUTPUT
echo "branch_name=${{ github.event.repository.default_branch }}" >> $GITHUB_OUTPUT
fi
env:
GH_TOKEN: ${{ github.token }}
ISSUE_NUMBER: ${{ github.event.issue.number || github.event.pull_request.number }}
- name: Checkout repository
uses: actions/checkout@v6
with:
repository: ${{ steps.pr_info.outputs.repo_full_name }}
ref: ${{ steps.pr_info.outputs.branch_name }}
fetch-depth: 0
- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@v1
env:
ANTHROPIC_BASE_URL: "${{ secrets.ANTHROPIC_BASE_URL }}"
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: 1
CLAUDE_CODE_ATTRIBUTION_HEADER: 0
DISABLE_TELEMETRY: 1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
claude_args: |
--model claude-opus-4-6
--max-turns 100