Objective
Fix the missing GH_AW_WORKFLOW_ID environment variable in the safe_outputs job context, which is causing all create_pull_request operations to fail.
Context
The create_pull_request safe output job requires GH_AW_WORKFLOW_ID to generate unique branch names in the format ${workflowId}-${randomHex}. Currently, this variable is set in the agent job but not propagated to the safe_outputs job, resulting in 100% failure rate (2/2 attempts failed).
Error: Error: GH_AW_WORKFLOW_ID environment variable is required
Approach
- Locate the workflow compilation code that generates the
safe_outputs job definition
- Identify where environment variables are passed to the
safe_outputs job
- Add
GH_AW_WORKFLOW_ID to the environment variables propagated to this job
- Ensure the variable is available in the agent job context (verify it exists)
- Test with the
security-fix-pr workflow or create a minimal test workflow
Files to Modify
- Workflow compiler code (likely in
pkg/workflow/ directory)
- Look for code that generates GitHub Actions YAML for safe_outputs job
- May need to update environment variable mapping/propagation logic
Acceptance Criteria
Testing
# After fix, test with:
./gh-aw compile .github/workflows/security-fix-pr.md
# Verify GH_AW_WORKFLOW_ID is in safe_outputs job env section
Priority
High - Blocking all PR creation via safe outputs
Related to #7023
AI generated by Plan Command for discussion #7018
Objective
Fix the missing
GH_AW_WORKFLOW_IDenvironment variable in thesafe_outputsjob context, which is causing allcreate_pull_requestoperations to fail.Context
The
create_pull_requestsafe output job requiresGH_AW_WORKFLOW_IDto generate unique branch names in the format${workflowId}-${randomHex}. Currently, this variable is set in the agent job but not propagated to thesafe_outputsjob, resulting in 100% failure rate (2/2 attempts failed).Error:
Error: GH_AW_WORKFLOW_ID environment variable is requiredApproach
safe_outputsjob definitionsafe_outputsjobGH_AW_WORKFLOW_IDto the environment variables propagated to this jobsecurity-fix-prworkflow or create a minimal test workflowFiles to Modify
pkg/workflow/directory)Acceptance Criteria
GH_AW_WORKFLOW_IDis available insafe_outputsjob environmentcreate_pull_requestoperations succeed in test workflowssecurity-fix-prworkflow succeedsTesting
Priority
High - Blocking all PR creation via safe outputs
Related to #7023