Skip to content

Commit 15dbe2e

Browse files
Fix: add more logging and early client check for Linear integration
Co-authored-by: Junie <[email protected]>
1 parent a3c6d8c commit 15dbe2e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/github/junie/prepare-junie.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,11 @@ export async function initializeJunieExecution({
6161
// Start Linear issue if this is a Linear-triggered workflow
6262
if (isLinearWorkflowDispatchEvent(context)) {
6363
try {
64+
console.log(`Starting Linear issue ${context.payload.issueId}...`);
6465
const client = getLinearClient();
6566
await client.addComment(context.payload.issueId, `🤖 Junie is starting work on this task (run ${context.runId})`);
6667
await client.startIssue(context.payload.issueId);
68+
console.log(`✓ Initial comment posted and issue started in Linear for ${context.payload.issueId}`);
6769
} catch (linearError) {
6870
console.warn('Failed to start Linear issue or post initial comment:', linearError);
6971
// Don't fail the workflow if Linear update fails
@@ -110,6 +112,12 @@ async function shouldHandle(context: JunieExecutionContext, octokit: Octokits):
110112
console.log(`Checking if Junie should handle event: ${context.eventName}`);
111113
if (isLinearWorkflowDispatchEvent(context)) {
112114
console.log("✓ Linear workflow dispatch detected - handling task");
115+
try {
116+
getLinearClient(); // Just to verify token early
117+
} catch (e) {
118+
console.warn(`Linear client initialization failed: ${e instanceof Error ? e.message : String(e)}`);
119+
// We don't return false here because we still want to try running the action
120+
}
113121
return true;
114122
}
115123

0 commit comments

Comments
 (0)