-
Notifications
You must be signed in to change notification settings - Fork 366
Better handling for required workflows #2356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Return the workflow path from the run rather than trying to fetch the workflow information when the workflow information is missing or refers to a required workflow.
// For required workflows, the workflowUrl is invalid so we cannot fetch more informations | ||
// about the workflow. | ||
// However, the path is available in the original response. | ||
return runsResponse.data.path as string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
runsResponse.data.path
Why isn't this value always correct? Is it because there are edge cases in normal workflow runs where the workflow may have been moved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know. I think it should be correct, but I can try to dig into the server-side logic to try to be sure. Right now this was meant to be backwards compatible.
Co-authored-by: Andrew Eisenberg <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, this is clearly correct. As Andrew mentions, it would be nice to see if we can use runsResponse.data.path
directly, but we should test this thoroughly to avoid stale tips.
@marcogario Unfortunately the rebuild workflow doesn't know how to fix linter errors — would you mind addressing these manually? |
Return the workflow path from the run rather than trying to fetch the workflow information when the workflow information is missing or refers to a required workflow.
This fixes the error:
I've tested this by setting up a required workflow using the action version from this version and confirmed it works.
Note: We are reporting the path as if it exists in the current repo, but that is not the case. Logic that relies on making a distinction here might be affected.
Merge / deployment checklist