mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-23 06:54:13 +08:00
* Add branch-name-template config option * Logging * Use branch name template * Add label to template variables * Add description template variable * More concise description for branch_name_template * Remove more granular time template variables * Only fetch first label * Add check for empty template-generated name * Clean up comments, docstrings * Merge createBranchTemplateVariables into generateBranchName * Still replace undefined values * Fall back to default on duplicate branch * Parameterize description wordcount * Remove some over-explanatory comments * NUM_DESCRIPTION_WORDS: 3 -> 5
140 lines
2.6 KiB
TypeScript
140 lines
2.6 KiB
TypeScript
// GraphQL queries for GitHub data
|
|
|
|
export const PR_QUERY = `
|
|
query($owner: String!, $repo: String!, $number: Int!) {
|
|
repository(owner: $owner, name: $repo) {
|
|
pullRequest(number: $number) {
|
|
title
|
|
body
|
|
author {
|
|
login
|
|
}
|
|
baseRefName
|
|
headRefName
|
|
headRefOid
|
|
createdAt
|
|
updatedAt
|
|
lastEditedAt
|
|
additions
|
|
deletions
|
|
state
|
|
labels(first: 1) {
|
|
nodes {
|
|
name
|
|
}
|
|
}
|
|
commits(first: 100) {
|
|
totalCount
|
|
nodes {
|
|
commit {
|
|
oid
|
|
message
|
|
author {
|
|
name
|
|
email
|
|
}
|
|
}
|
|
}
|
|
}
|
|
files(first: 100) {
|
|
nodes {
|
|
path
|
|
additions
|
|
deletions
|
|
changeType
|
|
}
|
|
}
|
|
comments(first: 100) {
|
|
nodes {
|
|
id
|
|
databaseId
|
|
body
|
|
author {
|
|
login
|
|
}
|
|
createdAt
|
|
updatedAt
|
|
lastEditedAt
|
|
isMinimized
|
|
}
|
|
}
|
|
reviews(first: 100) {
|
|
nodes {
|
|
id
|
|
databaseId
|
|
author {
|
|
login
|
|
}
|
|
body
|
|
state
|
|
submittedAt
|
|
updatedAt
|
|
lastEditedAt
|
|
comments(first: 100) {
|
|
nodes {
|
|
id
|
|
databaseId
|
|
body
|
|
path
|
|
line
|
|
author {
|
|
login
|
|
}
|
|
createdAt
|
|
updatedAt
|
|
lastEditedAt
|
|
isMinimized
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const ISSUE_QUERY = `
|
|
query($owner: String!, $repo: String!, $number: Int!) {
|
|
repository(owner: $owner, name: $repo) {
|
|
issue(number: $number) {
|
|
title
|
|
body
|
|
author {
|
|
login
|
|
}
|
|
createdAt
|
|
updatedAt
|
|
lastEditedAt
|
|
state
|
|
labels(first: 1) {
|
|
nodes {
|
|
name
|
|
}
|
|
}
|
|
comments(first: 100) {
|
|
nodes {
|
|
id
|
|
databaseId
|
|
body
|
|
author {
|
|
login
|
|
}
|
|
createdAt
|
|
updatedAt
|
|
lastEditedAt
|
|
isMinimized
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
export const USER_QUERY = `
|
|
query($login: String!) {
|
|
user(login: $login) {
|
|
name
|
|
}
|
|
}
|
|
`;
|