Skip to content

Commit 749f17f

Browse files
authored
Merge pull request #19 from LangMem/feat/cc_ci
feat: remove deprecated license information and add Claude Assistant …
2 parents cf57db6 + 2a7fe42 commit 749f17f

File tree

2 files changed

+116
-14
lines changed

2 files changed

+116
-14
lines changed

.github/workflows/auto-comment-for-clarity.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# Copyright 2024-2026 the original author or authors.
16-
#
17-
# Licensed under the Apache License, Version 2.0 (the "License");
18-
# you may not use this file except in compliance with the License.
19-
# You may obtain a copy of the License at
20-
#
21-
# https://www.apache.org/licenses/LICENSE-2.0
22-
#
23-
# Unless required by applicable law or agreed to in writing, software
24-
# distributed under the License is distributed on an "AS IS" BASIS,
25-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26-
# See the License for the specific language governing permissions and
27-
# limitations under the License.
28-
2915
name: Auto Comment for Clarity
3016
on:
3117
issues:

.github/workflows/claude.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# Copyright 2024-2026 the original author or authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Claude Assistant (Disabled)
16+
# Temporarily disabled to prevent automatic comments on issues
17+
on:
18+
workflow_dispatch: # Manual trigger only
19+
# Commented out automatic triggers:
20+
# issue_comment:
21+
# types: [created]
22+
# pull_request_review_comment:
23+
# types: [created]
24+
# pull_request_review:
25+
# types: [submitted]
26+
env:
27+
ANTHROPIC_BASE_URL: "https://open.bigmodel.cn/api/anthropic"
28+
jobs:
29+
claude-response:
30+
runs-on: ubuntu-latest
31+
permissions:
32+
contents: read
33+
pull-requests: read
34+
issues: write
35+
id-token: write
36+
steps:
37+
- name: Checkout repository
38+
uses: actions/checkout@v4
39+
with:
40+
fetch-depth: 1
41+
42+
- name: Run Claude Assistant
43+
id: claude_assistant
44+
uses: anthropics/claude-code-action@v1
45+
with:
46+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
47+
# Or use OAuth token instead:
48+
# claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
49+
50+
# Optional: provide a prompt for automation workflows
51+
# prompt: "Review this PR for security issues"
52+
53+
# Optional: pass advanced arguments to Claude CLI
54+
# claude_args: |
55+
# --max-turns 10
56+
# --model claude-4-0-sonnet-20250805
57+
58+
# Optional: add custom trigger phrase (default: @claude)
59+
# trigger_phrase: "/claude"
60+
# Optional: add assignee trigger for issues
61+
# assignee_trigger: "claude"
62+
# Optional: add label trigger for issues
63+
# label_trigger: "claude"
64+
# Optional: grant additional permissions (requires corresponding GitHub token permissions)
65+
# additional_permissions: |
66+
# actions: read
67+
# Optional: allow bot users to trigger the action
68+
# allowed_bots: "dependabot[bot],renovate[bot]"
69+
70+
- name: Post Claude assistant summary
71+
if: always() && (github.event_name == 'issues' || github.event_name == 'issue_comment')
72+
uses: actions/github-script@v7
73+
with:
74+
github-token: ${{ secrets.GITHUB_TOKEN }}
75+
script: |
76+
const owner = context.repo.owner;
77+
const repo = context.repo.repo;
78+
79+
// Get issue number from different event types
80+
let issue_number;
81+
if (context.eventName === 'issues') {
82+
issue_number = context.issue.number;
83+
} else if (context.eventName === 'issue_comment') {
84+
issue_number = context.payload.issue.number;
85+
} else {
86+
console.log('Event type not supported for issue comments');
87+
return;
88+
}
89+
90+
// Get Claude's response
91+
const stepOutputs = ${{ toJson(steps.claude_assistant.outputs) }};
92+
const claudeResponse = stepOutputs.response || stepOutputs.result || stepOutputs.output || '';
93+
94+
// Get workflow run URL
95+
const runUrl = `https://github.com/${owner}/${repo}/actions/runs/${{ github.run_id }}`;
96+
97+
let commentBody = `## 🤖 Claude Assistant Summary\n\n`;
98+
99+
if (claudeResponse && claudeResponse.trim() !== '') {
100+
commentBody += `**Claude Response:**\n\`\`\`\n${claudeResponse}\n\`\`\`\n\n`;
101+
} else {
102+
commentBody += `**Status:** Claude assistant completed processing.\n\n`;
103+
}
104+
105+
commentBody += `**Workflow Run:** [View Details](${runUrl})\n`;
106+
commentBody += `**Triggered by:** ${context.eventName}\n`;
107+
commentBody += `**Time:** ${new Date().toISOString()}\n\n`;
108+
commentBody += `---\n*This comment was automatically generated by the Claude Assistant workflow.*`;
109+
110+
await github.rest.issues.createComment({
111+
owner,
112+
repo,
113+
issue_number,
114+
body: commentBody
115+
});
116+
console.log('Posted Claude assistant summary to issue #' + issue_number);

0 commit comments

Comments
 (0)