-
Notifications
You must be signed in to change notification settings - Fork 379
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,6 +139,14 @@ export async function getWorkflowRelativePath(): Promise<string> { | |
); | ||
const workflowUrl = runsResponse.data.workflow_url; | ||
|
||
const requiredWorkflowRegex = /\/repos\/[^/]+\/[^/]+\/actions\/required_workflows\/[^/]+/; | ||
if (!workflowUrl || workflowUrl === "" || requiredWorkflowRegex.test(workflowUrl)) { | ||
// 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 commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
} | ||
|
||
const workflowResponse = await apiClient.request(`GET ${workflowUrl}`); | ||
|
||
return workflowResponse.data.path as string; | ||
|
Uh oh!
There was an error while loading. Please reload this page.