File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -265,10 +265,12 @@ export function extractJunieWorkflowContext(tokenOwner: TokenOwner): JunieExecut
265265 if ( process . env . LINEAR_API_TOKEN && process . env . ALL_INPUTS ) {
266266 try {
267267 const allInputs = JSON . parse ( process . env . ALL_INPUTS ) ;
268- if ( allInputs . action === LINEAR_EVENT_ACTION ) {
268+ if ( allInputs . action === LINEAR_EVENT_ACTION || ( allInputs . issue_id && allInputs . issue_title ) ) {
269+ console . log ( "✓ Detected Linear issue data in push event inputs - promoting to Linear event context" ) ;
269270 return extractLinearEventData ( { inputs : allInputs } as any , commonFields ) ;
270271 }
271- if ( allInputs . action === JIRA_EVENT_ACTION ) {
272+ if ( allInputs . action === JIRA_EVENT_ACTION || ( allInputs . issue_key && allInputs . issue_summary ) ) {
273+ console . log ( "✓ Detected Jira issue data in push event inputs - promoting to Jira event context" ) ;
272274 return extractJiraEventData ( { inputs : allInputs } as any , commonFields ) ;
273275 }
274276 } catch ( e ) {
@@ -578,6 +580,11 @@ export function isMinorFixEvent(context: JunieExecutionContext) {
578580export function isTriggeredByUserInteraction (
579581 context : JunieExecutionContext ,
580582) : context is UserInitiatedEventContext {
583+ // Exclude push events from "user interaction" because they don't have trigger phrases usually
584+ // and we want to avoid unnecessary permission checks on every push
585+ if ( context . eventName === "push" ) {
586+ return false ;
587+ }
581588 return USER_TRIGGERED_EVENTS . includes ( context . eventName as UserTriggeredEventName ) ;
582589}
583590
Original file line number Diff line number Diff line change @@ -110,13 +110,14 @@ export async function initializeJunieExecution({
110110
111111async function shouldHandle ( context : JunieExecutionContext , octokit : Octokits ) : Promise < boolean > {
112112 console . log ( `Checking if Junie should handle event: ${ context . eventName } ` ) ;
113+
114+ // Check for Linear/Jira first, regardless of event type (support push event triggers for tests)
113115 if ( isLinearWorkflowDispatchEvent ( context ) ) {
114116 console . log ( "✓ Linear task detected - handling task" ) ;
115117 try {
116118 getLinearClient ( ) ; // Just to verify token early
117119 } catch ( e ) {
118120 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
120121 }
121122 return true ;
122123 }
You can’t perform that action at this time.
0 commit comments