You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that a specific kind of errors in inputs of reusable workflows are getting ignored in "needs" context, causing a wrong result reported here.
Example setup that can trigger the issue: one job produces an output in json format (key-value), and another job (that calls a reusable workflow), takes as an input a specific value from the output of the first job by retrieving it via fromJson (e.g. fromJson(needs.job1.outputs.output_name).key), like in the example below. The last job checks status of all previous jobs by checking needs.*.result values.
The issue occur when the value under fromJson is empty, e.g. due to a typo in the output name - in this case:
the job calling a reusable workflow fails to be executed and is not displayed in GUI
the workflow itself is marked as failed with an error in summary: The template is not valid. Error parsing fromJson ... Error reading JToken from JsonReader. Path '', line 0, position 0.
but when we try to read the status of all jobs in the workflow from the "needs" context of the last job (which is always executed, regardless of the previous failures), the result of the problematic job is displayed as success.
Example workflow that triggers the issue
Here I purposefully provide the wrong output name in an input, and I expect it to fail the Overall_Status check:
How it looks in GUI (note that job2 is not even displayed among executed, but still successful according to "needs" context):
Expected behavior
I'd expect the result of the job that is specified in "needs" block but failed to be executed for any reason to be "failure" or empty (definitely not "success"). This may look like a corner case (or maybe I'm doing something wrong?), and there may be workarounds to take this issue into account when checking the overall status, but still it doesn't look right
BugSomething isn't working correctlyActionsBuild, test, and automate your deployment pipeline with world-class CI/CD
1 participant
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Select Topic Area
Bug
Body
It seems that a specific kind of errors in inputs of reusable workflows are getting ignored in "needs" context, causing a wrong result reported here.
Example setup that can trigger the issue: one job produces an output in json format (key-value), and another job (that calls a reusable workflow), takes as an input a specific value from the output of the first job by retrieving it via fromJson (e.g.
fromJson(needs.job1.outputs.output_name).key
), like in the example below. The last job checks status of all previous jobs by checking needs.*.result values.The issue occur when the value under fromJson is empty, e.g. due to a typo in the output name - in this case:
The template is not valid. Error parsing fromJson ... Error reading JToken from JsonReader. Path '', line 0, position 0.
Example workflow that triggers the issue
Here I purposefully provide the wrong output name in an input, and I expect it to fail the Overall_Status check:
How it looks in GUI (note that job2 is not even displayed among executed, but still successful according to "needs" context):
Expected behavior
I'd expect the result of the job that is specified in "needs" block but failed to be executed for any reason to be "failure" or empty (definitely not "success"). This may look like a corner case (or maybe I'm doing something wrong?), and there may be workarounds to take this issue into account when checking the overall status, but still it doesn't look right
Beta Was this translation helpful? Give feedback.
All reactions