Update misleading note in section-defining-outputs-for-jobs.md #33842
+46
−6
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.
Why:
Because note about handling outputs when using strategy matrix is misleading and wrong in multiple places. Here is my overview of what is wrong:
This is simply not true. Each step has it's own unique outputs file that it can write to. Next steps cannot override previous step outputs which is even show in usage example.
Using
$GITHUB_OUTPUT
does not override any job outputs. It can only set or override step outputs. Job need to define its own outputs and it can usesteps
context for this but this is not required for job outputs definition. Author of this note probably mixed step outputs with job outputs. Each job outputs inside matrix are combined, this is true, but author forgot to mention that last finished job in matrix will add new and override matching job outputs from all previous jobs.There is no way to use
contexts
within job outputs names. I tested it and always had an error from GitHub when trying to run workflow. Something like this is not allowed:What's being changed (if available, include any code snippets, screenshots, or gifs):
I've changed the note content and added an example of how matrix job outputs are combined.
Check off the following:
I have reviewed my changes in staging, available via the View deployment link in this PR's timeline (this link will be available after opening the PR).
data
directory.For content changes, I have completed the self-review checklist.