var action_0 = InputMap.get_actions()[0]
var action_0_events = InputMap.action_get_events( action_0 )
var action_0_event_0 = action_0_events[0]
var button_name = OS.get_keycode_string( action_0_event_0.keycode )
Godot 4 Beta 4
This should give you the desired String
Note that scanncode is now keycode