Add support for importing safe-outputs.jobs from shared workflows#4782
Merged
Add support for importing safe-outputs.jobs from shared workflows#4782
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for importing safe-outputs.jobs from shared workflow
Add support for importing safe-outputs.jobs from shared workflows
Nov 25, 2025
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where safe-outputs.jobs defined in shared workflows (via imports:) were not being merged into the main workflow. The root cause was an incorrect condition that prevented assignment of merged jobs when the main workflow already had jobs defined.
Key changes:
- Fixed the compiler logic to always use the merged jobs result, which already contains both main and imported jobs
- Added missing
nameanddescriptionproperties to the main workflow schema for consistency with the included file schema - Added comprehensive test coverage for job imports, including conflict detection
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/workflow/compiler.go | Removed incorrect condition that prevented merged jobs assignment when main workflow had existing jobs, ensuring both main and imported jobs are always included |
| pkg/parser/schemas/main_workflow_schema.json | Added name and description properties to safe-outputs.jobs schema to match included_file_schema.json |
| pkg/workflow/safe_outputs_import_test.go | Added three comprehensive test cases covering: importing jobs only, combining main and imported jobs, and detecting job name conflicts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
github-actions Bot
added a commit
that referenced
this pull request
Nov 26, 2025
Updates documentation for three major features merged in the last 24 hours: 1. CLI --ref flag (#4776) - Add --ref flag to gh aw status command - Add --ref flag to gh aw logs command - Shows latest run status when filtering by branch/tag 2. Import safe-outputs from shared workflows (#4761, #4782) - Document safe-outputs importing capability - Document safe output jobs import support - Explain conflict detection and meta field precedence 3. Custom job outputs support (#4778) - Document job output definition syntax - Show usage in agent prompts with needs context - Note string value requirement 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
safe-outputs.jobsdefined in shared workflows (viaimports:) were not being merged into the main workflow.Changes
nameanddescriptionproperties to safe-outputs.jobs inmain_workflow_schema.json(already present inincluded_file_schema.json)includedSafeJobsresult, which already contains both main and imported jobs with conflict detectionExample
Both
notifyandcleanupjobs are now correctly included in the compiled workflow.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/user/usr/bin/gh gh api user --jq .login(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.