Fix job id
This commit is contained in:
@@ -69,7 +69,7 @@ jobs:
|
|||||||
## Inputs
|
## Inputs
|
||||||
|
|
||||||
| Input | Description | Required | Default |
|
| Input | Description | Required | Default |
|
||||||
| --------------------- | -------------------------------------------------------------------------------------------------------------------- | -------- | ---------- |
|
| --------------------- | ------------------------------------------------------------------------------------------------------------------- | -------- | --------- |
|
||||||
| `anthropic_api_key` | Anthropic API key (required for direct API, not needed for Bedrock/Vertex) | No\* | - |
|
| `anthropic_api_key` | Anthropic API key (required for direct API, not needed for Bedrock/Vertex) | No\* | - |
|
||||||
| `direct_prompt` | Direct prompt for Claude to execute automatically without needing a trigger (for automated workflows) | No | - |
|
| `direct_prompt` | Direct prompt for Claude to execute automatically without needing a trigger (for automated workflows) | No | - |
|
||||||
| `timeout_minutes` | Timeout in minutes for execution | No | `30` |
|
| `timeout_minutes` | Timeout in minutes for execution | No | `30` |
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ async function run() {
|
|||||||
const client = createClient(githubToken);
|
const client = createClient(githubToken);
|
||||||
|
|
||||||
const serverUrl = GITEA_SERVER_URL;
|
const serverUrl = GITEA_SERVER_URL;
|
||||||
const jobUrl = `${serverUrl}/${owner}/${repo}/actions/runs/${process.env.GITHUB_RUN_ID}`;
|
const jobUrl = `${serverUrl}/${owner}/${repo}/actions/runs/${process.env.GITHUB_RUN_NUMBER}`;
|
||||||
|
|
||||||
let comment;
|
let comment;
|
||||||
let isPRReviewComment = false;
|
let isPRReviewComment = false;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export function parseGitHubContext(): ParsedGitHubContext {
|
|||||||
const context = github.context;
|
const context = github.context;
|
||||||
|
|
||||||
const commonFields = {
|
const commonFields = {
|
||||||
runId: process.env.GITHUB_RUN_ID!,
|
runId: process.env.GITHUB_RUN_NUMBER!,
|
||||||
eventName: context.eventName,
|
eventName: context.eventName,
|
||||||
eventAction: context.payload.action,
|
eventAction: context.payload.action,
|
||||||
repository: {
|
repository: {
|
||||||
|
|||||||
@@ -136,11 +136,15 @@ server.tool(
|
|||||||
create_if_missing: z
|
create_if_missing: z
|
||||||
.boolean()
|
.boolean()
|
||||||
.optional()
|
.optional()
|
||||||
.describe("Create branch if it doesn't exist locally (defaults to false)"),
|
.describe(
|
||||||
|
"Create branch if it doesn't exist locally (defaults to false)",
|
||||||
|
),
|
||||||
fetch_remote: z
|
fetch_remote: z
|
||||||
.boolean()
|
.boolean()
|
||||||
.optional()
|
.optional()
|
||||||
.describe("Fetch from remote if branch doesn't exist locally (defaults to true)"),
|
.describe(
|
||||||
|
"Fetch from remote if branch doesn't exist locally (defaults to true)",
|
||||||
|
),
|
||||||
},
|
},
|
||||||
async ({ branch_name, create_if_missing = false, fetch_remote = true }) => {
|
async ({ branch_name, create_if_missing = false, fetch_remote = true }) => {
|
||||||
try {
|
try {
|
||||||
@@ -150,17 +154,23 @@ server.tool(
|
|||||||
runGitCommand(`git rev-parse --verify ${branch_name}`);
|
runGitCommand(`git rev-parse --verify ${branch_name}`);
|
||||||
branchExists = true;
|
branchExists = true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(`[LOCAL-GIT-MCP] Branch ${branch_name} doesn't exist locally`);
|
console.log(
|
||||||
|
`[LOCAL-GIT-MCP] Branch ${branch_name} doesn't exist locally`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If branch doesn't exist locally, try to fetch from remote
|
// If branch doesn't exist locally, try to fetch from remote
|
||||||
if (!branchExists && fetch_remote) {
|
if (!branchExists && fetch_remote) {
|
||||||
try {
|
try {
|
||||||
console.log(`[LOCAL-GIT-MCP] Attempting to fetch ${branch_name} from remote`);
|
console.log(
|
||||||
|
`[LOCAL-GIT-MCP] Attempting to fetch ${branch_name} from remote`,
|
||||||
|
);
|
||||||
runGitCommand(`git fetch origin ${branch_name}:${branch_name}`);
|
runGitCommand(`git fetch origin ${branch_name}:${branch_name}`);
|
||||||
branchExists = true;
|
branchExists = true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(`[LOCAL-GIT-MCP] Branch ${branch_name} doesn't exist on remote`);
|
console.log(
|
||||||
|
`[LOCAL-GIT-MCP] Branch ${branch_name} doesn't exist on remote`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,7 +190,9 @@ server.tool(
|
|||||||
|
|
||||||
// If branch doesn't exist and we can't/won't create it, throw error
|
// If branch doesn't exist and we can't/won't create it, throw error
|
||||||
if (!branchExists) {
|
if (!branchExists) {
|
||||||
throw new Error(`Branch '${branch_name}' does not exist locally or on remote. Use create_if_missing=true to create it.`);
|
throw new Error(
|
||||||
|
`Branch '${branch_name}' does not exist locally or on remote. Use create_if_missing=true to create it.`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checkout the existing branch
|
// Checkout the existing branch
|
||||||
|
|||||||
Reference in New Issue
Block a user