@@ -254,11 +254,29 @@ export function extractJunieWorkflowContext(tokenOwner: TokenOwner): JunieExecut
254254 }
255255 case "push" : {
256256 const payload = context . payload as PushEvent ;
257- parsedContext = {
257+
258+ const baseContext = {
258259 ...commonFields ,
259260 eventName : context . eventName ,
260261 payload : payload
261262 } ;
263+
264+ // Support triggered Linear/Jira tasks even on push events (e.g. for testing)
265+ if ( process . env . LINEAR_API_TOKEN && process . env . ALL_INPUTS ) {
266+ try {
267+ const allInputs = JSON . parse ( process . env . ALL_INPUTS ) ;
268+ if ( allInputs . action === LINEAR_EVENT_ACTION ) {
269+ return extractLinearEventData ( { inputs : allInputs } as any , commonFields ) ;
270+ }
271+ if ( allInputs . action === JIRA_EVENT_ACTION ) {
272+ return extractJiraEventData ( { inputs : allInputs } as any , commonFields ) ;
273+ }
274+ } catch ( e ) {
275+ console . warn ( "Failed to parse ALL_INPUTS for action check:" , e ) ;
276+ }
277+ }
278+
279+ parsedContext = baseContext ;
262280 break
263281 }
264282 case "workflow_dispatch" : {
@@ -459,19 +477,19 @@ function extractLinearEventData(workflowPayload: WorkflowDispatchEvent, context:
459477export function isJiraWorkflowDispatchEvent ( context : JunieExecutionContext ) : context is AutomationEventContext & {
460478 payload : JiraIssuePayload
461479} {
462- return context . eventName === "workflow_dispatch" && 'action' in context . payload && context . payload . action === JIRA_EVENT_ACTION ;
480+ return 'action' in context . payload && context . payload . action === JIRA_EVENT_ACTION ;
463481}
464482
465483export function isLinearWorkflowDispatchEvent ( context : JunieExecutionContext ) : context is AutomationEventContext & {
466484 payload : LinearIssuePayload
467485} {
468- return context . eventName === "workflow_dispatch" && 'action' in context . payload && context . payload . action === LINEAR_EVENT_ACTION ;
486+ return 'action' in context . payload && context . payload . action === LINEAR_EVENT_ACTION ;
469487}
470488
471489export function isResolveConflictsWorkflowDispatchEvent ( context : JunieExecutionContext ) : context is AutomationEventContext & {
472490 payload : ResolveConflictsEventPayload
473491} {
474- return context . eventName === "workflow_dispatch" && 'action' in context . payload && context . payload . action === RESOLVE_CONFLICTS_ACTION ;
492+ return 'action' in context . payload && context . payload . action === RESOLVE_CONFLICTS_ACTION ;
475493}
476494
477495export function isCheckSuiteEvent ( context : JunieExecutionContext ) : context is AutomationEventContext & {
0 commit comments