File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -590,15 +590,17 @@ pub fn find_head() -> Result<String> {
590590/// Extracts the PR head SHA from GitHub Actions event payload JSON.
591591/// Returns None if not a PR event or if SHA cannot be extracted.
592592fn extract_pr_head_sha_from_event ( json_content : & str ) -> Option < String > {
593- let payload : GitHubEventPayload = match serde_json:: from_str ( json_content) {
594- Ok ( payload ) => payload ,
593+ let v : Value = match serde_json:: from_str ( json_content) {
594+ Ok ( v ) => v ,
595595 Err ( _) => {
596596 debug ! ( "Failed to parse GitHub event payload as JSON" ) ;
597597 return None ;
598598 }
599599 } ;
600600
601- Some ( payload. pull_request ?. head . sha )
601+ v. pointer ( "/pull_request/head/sha" )
602+ . and_then ( |s| s. as_str ( ) )
603+ . map ( |s| s. to_owned ( ) )
602604}
603605
604606/// Given commit specs, repos and remote_name this returns a list of head
You can’t perform that action at this time.
0 commit comments