The actress, who plays Tina McIntrye on the soap, posted a picture of her and co-star Jack P Shepherd relaxing during a filming break with the scripts on the table.
The dialogue of the script allegedly gave away the outcome of the DNA test that Shepherd's character David will organise behind wife Kylie's back.
Keegan quickly deleted the image, but a number of Twitter users had already retweeted and saved the image before she removed it.
David will organise a DNA test to determine whether he is the father of Kylie's baby, after she gives birth to a girl next month.
Digital Spy Soap Scoop video - press play below to watch Amie Parker-Williams reveal gossip on a murder probe in Emmerdale, a shock discovery for Tina in Coronation Street, a blackmail plan in EastEnders and a surprise windfall in Hollyoaks: