Better handling for required workflows#2356
Merged
marcogario merged 4 commits intomainfrom Jul 1, 2024
Merged
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.
aeisenberg
reviewed
Jun 27, 2024
| // 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; |
Contributor
There was a problem hiding this comment.
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?
Contributor
Author
There was a problem hiding this comment.
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 <aeisenberg@github.com>
henrymercer
previously approved these changes
Jul 1, 2024
Contributor
henrymercer
left a comment
There was a problem hiding this comment.
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.
Contributor
|
@marcogario Unfortunately the rebuild workflow doesn't know how to fix linter errors — would you mind addressing these manually? |
henrymercer
approved these changes
Jul 1, 2024
This was referenced Jul 12, 2024
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.
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