mirror of
https://github.com/anthropics/claude-code.git
synced 2026-05-01 10:22:45 +00:00
Compare commits
8 Commits
feat/devco
...
workflow-u
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0a28eede9 | ||
|
|
81f65bea8a | ||
|
|
dc8f77c7ef | ||
|
|
786259a00c | ||
|
|
8e679e75f7 | ||
|
|
87560460bc | ||
|
|
d820a4dbd7 | ||
|
|
20ba9a34a5 |
59
.github/workflows/issue-notify.yml
vendored
Normal file
59
.github/workflows/issue-notify.yml
vendored
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
name: Issue Notification
|
||||||
|
|
||||||
|
on:
|
||||||
|
issues:
|
||||||
|
types: [opened]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
issues: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
notify:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 5
|
||||||
|
steps:
|
||||||
|
- name: Send notification
|
||||||
|
env:
|
||||||
|
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||||
|
ISSUE_TITLE: ${{ github.event.issue.title }}
|
||||||
|
ISSUE_BODY: ${{ github.event.issue.body }}
|
||||||
|
ISSUE_AUTHOR: ${{ github.event.issue.user.login }}
|
||||||
|
ISSUE_LABELS: ${{ toJSON(github.event.issue.labels) }}
|
||||||
|
ISSUE_URL: ${{ github.event.issue.html_url }}
|
||||||
|
ISSUE_CREATED_AT: ${{ github.event.issue.created_at }}
|
||||||
|
REPOSITORY: ${{ github.repository }}
|
||||||
|
DISPATCH_TOKEN: ${{ secrets.CROSS_REPO_TOKEN_CLAUDE_CODE }}
|
||||||
|
DISPATCH_ENDPOINT: ${{ secrets.DISPATCH_ENDPOINT }}
|
||||||
|
run: |
|
||||||
|
if [ -z "$DISPATCH_TOKEN" ] || [ -z "$DISPATCH_ENDPOINT" ]; then
|
||||||
|
echo "Dispatch configuration not complete, skipping notification"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Prepare payload with issue metadata
|
||||||
|
PAYLOAD=$(cat <<EOF
|
||||||
|
{
|
||||||
|
"event_type": "issue_event",
|
||||||
|
"client_payload": {
|
||||||
|
"source_repo": "$REPOSITORY",
|
||||||
|
"issue_number": "$ISSUE_NUMBER",
|
||||||
|
"issue_title": $(echo "$ISSUE_TITLE" | jq -Rs .),
|
||||||
|
"issue_body": $(echo "$ISSUE_BODY" | jq -Rs .),
|
||||||
|
"issue_author": "$ISSUE_AUTHOR",
|
||||||
|
"issue_labels": $ISSUE_LABELS,
|
||||||
|
"issue_url": "$ISSUE_URL",
|
||||||
|
"issue_created_at": "$ISSUE_CREATED_AT",
|
||||||
|
"timestamp": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
# Send notification to configured endpoint
|
||||||
|
curl -X POST \
|
||||||
|
-H "Accept: application/vnd.github.v3+json" \
|
||||||
|
-H "Authorization: token $DISPATCH_TOKEN" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
"$DISPATCH_ENDPOINT" \
|
||||||
|
-d "$PAYLOAD" \
|
||||||
|
--fail-with-body || echo "Notification sent"
|
||||||
2
.github/workflows/log-issue-events.yml
vendored
2
.github/workflows/log-issue-events.yml
vendored
@@ -2,7 +2,7 @@ name: Log Issue Events to Statsig
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
issues:
|
issues:
|
||||||
types: [opened]
|
types: [opened, closed]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
log-to-statsig:
|
log-to-statsig:
|
||||||
|
|||||||
12
CHANGELOG.md
12
CHANGELOG.md
@@ -1,8 +1,20 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 1.0.97
|
||||||
|
|
||||||
|
- Settings: /doctor now validates permission rule syntax and suggests corrections
|
||||||
|
|
||||||
|
## 1.0.94
|
||||||
|
|
||||||
|
- Vertex: add support for global endpoints for supported models
|
||||||
|
- /memory command now allows direct editing of all imported memory files
|
||||||
|
- SDK: Add custom tools as callbacks
|
||||||
|
- Added /todos command to list current todo items
|
||||||
|
|
||||||
## 1.0.93
|
## 1.0.93
|
||||||
|
|
||||||
- Windows: Add alt + v shortcut for pasting images from clipboard
|
- Windows: Add alt + v shortcut for pasting images from clipboard
|
||||||
|
- Support NO_PROXY environment variable to bypass proxy for specified hostnames and IPs
|
||||||
|
|
||||||
## 1.0.90
|
## 1.0.90
|
||||||
|
|
||||||
|
|||||||
@@ -82,46 +82,61 @@ Usage:
|
|||||||
Environment Variables:
|
Environment Variables:
|
||||||
GITHUB_TOKEN - GitHub personal access token with repo and actions permissions (required)
|
GITHUB_TOKEN - GitHub personal access token with repo and actions permissions (required)
|
||||||
DRY_RUN - Set to "false" to actually trigger workflows (default: true for safety)
|
DRY_RUN - Set to "false" to actually trigger workflows (default: true for safety)
|
||||||
DAYS_BACK - How many days back to look for old issues (default: 90)`);
|
MAX_ISSUE_NUMBER - Only process issues with numbers less than this value (default: 4050)`);
|
||||||
}
|
}
|
||||||
console.log("[DEBUG] GitHub token found");
|
console.log("[DEBUG] GitHub token found");
|
||||||
|
|
||||||
const owner = "anthropics";
|
const owner = "anthropics";
|
||||||
const repo = "claude-code";
|
const repo = "claude-code";
|
||||||
const dryRun = process.env.DRY_RUN !== "false";
|
const dryRun = process.env.DRY_RUN !== "false";
|
||||||
const daysBack = parseInt(process.env.DAYS_BACK || "90", 10);
|
const maxIssueNumber = parseInt(process.env.MAX_ISSUE_NUMBER || "4050", 10);
|
||||||
|
const minIssueNumber = parseInt(process.env.MIN_ISSUE_NUMBER || "1", 10);
|
||||||
|
|
||||||
console.log(`[DEBUG] Repository: ${owner}/${repo}`);
|
console.log(`[DEBUG] Repository: ${owner}/${repo}`);
|
||||||
console.log(`[DEBUG] Dry run mode: ${dryRun}`);
|
console.log(`[DEBUG] Dry run mode: ${dryRun}`);
|
||||||
console.log(`[DEBUG] Looking back ${daysBack} days`);
|
console.log(`[DEBUG] Looking at issues between #${minIssueNumber} and #${maxIssueNumber}`);
|
||||||
|
|
||||||
const cutoffDate = new Date();
|
console.log(`[DEBUG] Fetching issues between #${minIssueNumber} and #${maxIssueNumber}...`);
|
||||||
cutoffDate.setDate(cutoffDate.getDate() - daysBack);
|
|
||||||
|
|
||||||
console.log(`[DEBUG] Fetching issues created since ${cutoffDate.toISOString()}...`);
|
|
||||||
const allIssues: GitHubIssue[] = [];
|
const allIssues: GitHubIssue[] = [];
|
||||||
let page = 1;
|
let page = 1;
|
||||||
const perPage = 100;
|
const perPage = 100;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
const pageIssues: GitHubIssue[] = await githubRequest(
|
const pageIssues: GitHubIssue[] = await githubRequest(
|
||||||
`/repos/${owner}/${repo}/issues?state=all&per_page=${perPage}&page=${page}&since=${cutoffDate.toISOString()}`,
|
`/repos/${owner}/${repo}/issues?state=all&per_page=${perPage}&page=${page}&sort=created&direction=desc`,
|
||||||
token
|
token
|
||||||
);
|
);
|
||||||
|
|
||||||
if (pageIssues.length === 0) break;
|
if (pageIssues.length === 0) break;
|
||||||
|
|
||||||
allIssues.push(...pageIssues);
|
// Filter to only include issues within the specified range
|
||||||
|
const filteredIssues = pageIssues.filter(issue =>
|
||||||
|
issue.number >= minIssueNumber && issue.number < maxIssueNumber
|
||||||
|
);
|
||||||
|
allIssues.push(...filteredIssues);
|
||||||
|
|
||||||
|
// If the oldest issue in this page is still above our minimum, we need to continue
|
||||||
|
// but if the oldest issue is below our minimum, we can stop
|
||||||
|
const oldestIssueInPage = pageIssues[pageIssues.length - 1];
|
||||||
|
if (oldestIssueInPage && oldestIssueInPage.number >= maxIssueNumber) {
|
||||||
|
console.log(`[DEBUG] Oldest issue in page #${page} is #${oldestIssueInPage.number}, continuing...`);
|
||||||
|
} else if (oldestIssueInPage && oldestIssueInPage.number < minIssueNumber) {
|
||||||
|
console.log(`[DEBUG] Oldest issue in page #${page} is #${oldestIssueInPage.number}, below minimum, stopping`);
|
||||||
|
break;
|
||||||
|
} else if (filteredIssues.length === 0 && pageIssues.length > 0) {
|
||||||
|
console.log(`[DEBUG] No issues in page #${page} are in range #${minIssueNumber}-#${maxIssueNumber}, continuing...`);
|
||||||
|
}
|
||||||
|
|
||||||
page++;
|
page++;
|
||||||
|
|
||||||
// Safety limit to avoid infinite loops
|
// Safety limit to avoid infinite loops
|
||||||
if (page > 100) {
|
if (page > 200) {
|
||||||
console.log("[DEBUG] Reached page limit, stopping pagination");
|
console.log("[DEBUG] Reached page limit, stopping pagination");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`[DEBUG] Found ${allIssues.length} issues from the last ${daysBack} days`);
|
console.log(`[DEBUG] Found ${allIssues.length} issues between #${minIssueNumber} and #${maxIssueNumber}`);
|
||||||
|
|
||||||
let processedCount = 0;
|
let processedCount = 0;
|
||||||
let candidateCount = 0;
|
let candidateCount = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user