Compare commits

..

1 Commits

Author SHA1 Message Date
Ashwin Bhat
d8c32e444e Update issue templates 2025-05-27 13:16:42 -07:00
3 changed files with 53 additions and 20 deletions

36
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,36 @@
---
name: Bug report
about: Create a report to help us improve
title: ""
labels: bug
assignees: ""
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Workflow yml file**
If it's not sensitive, consider including a paste of your full Claude workflow.yml file.
**API Provider**
[ ] Anthropic First-Party API (default)
[ ] AWS Bedrock
[ ] GCP Vertex
**Additional context**
Add any other context about the problem here.

View File

@@ -51,9 +51,8 @@ export async function setupBranch(
const branchName = prData.headRefName;
// Execute git commands to checkout PR branch (shallow fetch for performance)
// Fetch the branch with a depth of 20 to avoid fetching too much history, while still allowing for some context
await $`git fetch origin --depth=20 ${branchName}`;
// Execute git commands to checkout PR branch
await $`git fetch origin ${branchName}`;
await $`git checkout ${branchName}`;
console.log(`Successfully checked out PR branch for PR #${entityNumber}`);
@@ -99,8 +98,8 @@ export async function setupBranch(
sha: currentSHA,
});
// Checkout the new branch (shallow fetch for performance)
await $`git fetch origin --depth=1 ${newBranch}`;
// Checkout the new branch
await $`git fetch origin ${newBranch}`;
await $`git checkout ${newBranch}`;
console.log(

View File

@@ -39,19 +39,25 @@ async function retryWithBackoff<T>(
}
}
console.error(`Operation failed after ${maxAttempts} attempts`);
throw lastError;
throw new Error(
`Operation failed after ${maxAttempts} attempts. Last error: ${
lastError?.message ?? "Unknown error"
}`,
);
}
async function getOidcToken(): Promise<string> {
try {
const oidcToken = await core.getIDToken("claude-code-github-action");
if (!oidcToken) {
throw new Error("OIDC token not found");
}
return oidcToken;
} catch (error) {
console.error("Failed to get OIDC token:", error);
throw new Error(
"Could not fetch an OIDC token. Did you remember to add `id-token: write` to your workflow permissions?",
`Failed to get OIDC token: ${error instanceof Error ? error.message : String(error)}`,
);
}
}
@@ -68,15 +74,9 @@ async function exchangeForAppToken(oidcToken: string): Promise<string> {
);
if (!response.ok) {
const responseJson = (await response.json()) as {
error?: {
message?: string;
};
};
console.error(
`App token exchange failed: ${response.status} ${response.statusText} - ${responseJson?.error?.message ?? "Unknown error"}`,
throw new Error(
`App token exchange failed: ${response.status} ${response.statusText}`,
);
throw new Error(`${responseJson?.error?.message ?? "Unknown error"}`);
}
const appTokenData = (await response.json()) as {
@@ -117,9 +117,7 @@ export async function setupGitHubToken(): Promise<string> {
core.setOutput("GITHUB_TOKEN", appToken);
return appToken;
} catch (error) {
core.setFailed(
`Failed to setup GitHub token: ${error}.\n\nIf you instead wish to use this action with a custom GitHub token or custom GitHub app, provide a \`github_token\` in the \`uses\` section of the app in your workflow yml file.`,
);
core.setFailed(`Failed to setup GitHub token: ${error}`);
process.exit(1);
}
}