It works similar to getActionFrame(), you have to give a layer or not (for layer 0) as the argument and it returns the name of the animation that the object is currently playing.
Example:
import bge
own = bge.logic.getCurrentController().owner
own.playAction("SomeAction",0,20)
print(own.getActionName())SomeAction
Here is an example file, just open the blend file with the terminal opened
and press P, you can see how the current animation is being printed: