Created
October 12, 2023 06:27
Revisions
-
larshp created this gist
Oct 12, 2023 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ METHOD zif_abapgit_exit~wall_message_repo. DATA(lv_url) = is_repo_meta-url. DATA(lo_agent) = zcl_abapgit_factory=>get_http_agent( ). IF zcl_abapgit_login_manager=>get( lv_url ) IS NOT INITIAL. lo_agent->global_headers( )->set( iv_key = 'Authorization' iv_val = zcl_abapgit_login_manager=>get( lv_url ) ). ENDIF. lv_url = replace( val = is_repo_meta-url sub = 'github.com' with = 'api.github.com/repos' ). lv_url = lv_url && '/topics'. lo_agent->global_headers( )->set( iv_key = 'Accept' iv_val = 'application/vnd.github+json' ). DATA(li_json) = lo_agent->request( lv_url )->json( ). DATA(lt_topics) = li_json->array_to_string_table( '/names/' ). READ TABLE lt_topics WITH KEY table_line = |sap-{ to_lower( sy-sysid ) }| TRANSPORTING NO FIELDS. IF sy-subrc <> 0. ii_html->add( |<div class="form-container">Please add topic "sap-{ to_lower( sy-sysid ) }" to the repository on github</div>| ). ENDIF. ENDMETHOD.