File tree Expand file tree Collapse file tree
tools/release/src/targets Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,25 +58,15 @@ impl GithubRelease {
5858 cmd. read ( )
5959 . map ( |s| s. trim ( ) . to_owned ( ) )
6060 . map_err ( |e| format ! ( "Failed to execute dispatch attach-artifacts.yml: {e}" ) )
61- . and_then ( |output | Self :: run_id_from_output ( & output ) . map ( str:: to_owned) )
61+ . and_then ( |url | Self :: run_id_from_url ( & url ) . map ( str:: to_owned) )
6262 }
6363
64- fn run_id_from_output ( output : & str ) -> Result < & str , String > {
65- let url = output
66- . split_whitespace ( )
67- . find ( |word| word. starts_with ( "https://" ) && word. contains ( "/actions/runs/" ) )
68- . unwrap_or ( output) ;
69-
64+ fn run_id_from_url ( url : & str ) -> Result < & str , String > {
7065 url. trim_end_matches ( '/' )
7166 . rsplit ( '/' )
7267 . next ( )
7368 . filter ( |segment| !segment. is_empty ( ) && segment. chars ( ) . all ( |ch| ch. is_ascii_digit ( ) ) )
74- . ok_or_else ( || {
75- format ! (
76- "Could not parse workflow run id from gh workflow run output: {}" ,
77- output
78- )
79- } )
69+ . ok_or_else ( || format ! ( "Could not parse workflow run id from URL: {}" , url) )
8070 }
8171
8272 fn wait_for_workflow ( & self , run_id : & str ) -> Result < ( ) , String > {
You can’t perform that action at this time.
0 commit comments