You tell your allies about a surprise attack, you risk telling the wrong person and spoiling the surprise.
Adolf Hitler didn't know about the Japanese attack on Pearl Harbor until after it happened, and thought it was just a propaganda trick at first. But once the news was verified, he didn't complain to Japan about not telling him beforehand. He declared war on the United States.