Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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": [
Expand All @@ -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": {
Expand Down
14 changes: 13 additions & 1 deletion src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,19 @@ export const getCurrentBranchName = async (cwd?: string): Promise<string> => {
};

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();
Expand Down Expand Up @@ -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');

Expand Down