diff --git a/package.json b/package.json index 61187a5..2ec1158 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@grunnverk/github-tools", - "version": "1.5.0", + "version": "1.5.1", "description": "GitHub API utilities for automation - PR management, issue tracking, workflow monitoring", "main": "dist/index.js", "type": "module", @@ -26,7 +26,7 @@ "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "clean": "rm -rf dist", - "precommit": "npm run clean && npm run build && npm run lint && npm run test", + "precommit": "npm run lint && npm run build && npm run test", "prepublishOnly": "npm run clean && npm run lint && npm run build && npm run test" }, "keywords": [ @@ -45,7 +45,7 @@ "node": ">=24.0.0" }, "dependencies": { - "@grunnverk/git-tools": "^1.5.0", + "@grunnverk/git-tools": "^1.5.1", "@octokit/rest": "^22.0.0" }, "peerDependencies": { diff --git a/src/github.ts b/src/github.ts index 0caa3e1..748f931 100644 --- a/src/github.ts +++ b/src/github.ts @@ -41,6 +41,19 @@ export const getCurrentBranchName = async (cwd?: string): Promise => { }; export const getRepoDetails = async (cwd?: string): Promise<{ owner: string; repo: string }> => { + const logger = getLogger(); + + // Check for context from environment (set by parallel execution) + if (process.env.KODRDRIV_CONTEXT_REPOSITORY_OWNER && process.env.KODRDRIV_CONTEXT_REPOSITORY_NAME) { + const owner = process.env.KODRDRIV_CONTEXT_REPOSITORY_OWNER; + const repo = process.env.KODRDRIV_CONTEXT_REPOSITORY_NAME; + + logger.debug(`Using repository details from execution context: ${owner}/${repo}`); + + return { owner, repo }; + } + + // Fall back to git detection (sequential mode) try { const { stdout } = await run('git remote get-url origin', { cwd, suppressErrorLogging: true }); const url = stdout.trim(); @@ -70,7 +83,6 @@ export const getRepoDetails = async (cwd?: string): Promise<{ owner: string; rep return { owner, repo }; } catch (error: any) { - const logger = getLogger(); const isNotGitRepo = error.message.includes('not a git repository'); const hasNoOrigin = error.message.includes('remote origin does not exist');