mirror of
https://github.com/markwylde/claude-code-gitea-action.git
synced 2026-02-21 11:32:49 +08:00
chore: pull in latest
This commit is contained in:
@@ -7,8 +7,25 @@ function deriveApiUrl(serverUrl: string): string {
|
||||
return `${serverUrl}/api/v1`;
|
||||
}
|
||||
|
||||
export const GITEA_SERVER_URL =
|
||||
process.env.GITHUB_SERVER_URL || "https://github.com";
|
||||
// Get the appropriate server URL, prioritizing GITEA_SERVER_URL for custom Gitea instances
|
||||
function getServerUrl(): string {
|
||||
// First check for GITEA_SERVER_URL (can be set by user)
|
||||
const giteaServerUrl = process.env.GITEA_SERVER_URL;
|
||||
if (giteaServerUrl && giteaServerUrl !== "") {
|
||||
return giteaServerUrl;
|
||||
}
|
||||
|
||||
// Fall back to GITHUB_SERVER_URL (set by Gitea/GitHub Actions environment)
|
||||
const githubServerUrl = process.env.GITHUB_SERVER_URL;
|
||||
if (githubServerUrl && githubServerUrl !== "") {
|
||||
return githubServerUrl;
|
||||
}
|
||||
|
||||
// Default fallback
|
||||
return "https://github.com";
|
||||
}
|
||||
|
||||
export const GITEA_SERVER_URL = getServerUrl();
|
||||
|
||||
export const GITEA_API_URL =
|
||||
process.env.GITEA_API_URL || deriveApiUrl(GITEA_SERVER_URL);
|
||||
|
||||
@@ -52,7 +52,7 @@ export async function setupBranch(
|
||||
);
|
||||
|
||||
// Check out the base branch and let Claude create branches as needed
|
||||
await $`git fetch origin ${sourceBranch}`;
|
||||
await $`git fetch origin --depth=1 ${sourceBranch}`;
|
||||
await $`git checkout ${sourceBranch}`;
|
||||
await $`git pull origin ${sourceBranch}`;
|
||||
|
||||
@@ -99,7 +99,7 @@ export async function setupBranch(
|
||||
|
||||
// Ensure we have the latest version of the source branch
|
||||
console.log(`Fetching latest ${sourceBranch}...`);
|
||||
await $`git fetch origin ${sourceBranch}`;
|
||||
await $`git fetch origin --depth=1 ${sourceBranch}`;
|
||||
|
||||
// Checkout the source branch
|
||||
console.log(`Checking out ${sourceBranch}...`);
|
||||
|
||||
@@ -85,7 +85,7 @@ export async function branchHasChanges(
|
||||
*/
|
||||
export async function fetchBranch(branchName: string): Promise<boolean> {
|
||||
try {
|
||||
await $`git fetch origin ${branchName}`;
|
||||
await $`git fetch origin --depth=1 ${branchName}`;
|
||||
return true;
|
||||
} catch (error) {
|
||||
console.log(
|
||||
|
||||
Reference in New Issue
Block a user