Add functionality for parsing Action inputs from a workflow file#1392
Add functionality for parsing Action inputs from a workflow file#1392henrymercer merged 8 commits intomainfrom
Conversation
No semantic changes.
This is a common case, so we should handle it.
This better handles cases where customers have a monorepo and have separate jobs for different components.
aeisenberg
left a comment
There was a problem hiding this comment.
OK. This will now throw if we can't determine what the actual input value is. I don't actually see where getting the category is being used. Is that coming in a later PR? We should make sure that the action doesn't fail if it can't find the category (most likely, the action will already have failed for some other reason, so we need to at least make sure that this failure doesn't hide the original failure).
|
This functionality is just for #1393 — ideally we'd minimise the number of places where we need to do this hacky parsing of the workflow. We wrap it in a try-catch block there to avoid hiding the original failure as you mention. I think the |
|
I think that all makes sense. I'll review #1393 later today. Maybe just adding a comment to the function suggesting that it should be wrapped in a try-catch. |
aeisenberg
left a comment
There was a problem hiding this comment.
LGTM. Optionally, add a comment to the tryOrThrow... functions to suggest wrapping in try-catch.
In order to upload SARIF files for code scanning runs where the
initstep failed, we need to be able to handle the case where theanalyzeAction did not run. In this case, thepost-analyzestep will not be run, and therefore we don't know the inputs toanalyze. (In particular, we care aboutcategory,upload, andcheckout_path.)This PR implements some functionality to make a best effort attempt to work out the value of an input to an Action given the workflow file and information that's available to the
initstep like matrix variables. I recommend reviewing the first commit separately since it separates out workflow-related code into a separate fileworkflow.ts.Merge / deployment checklist