I remember reading something that claimed that Israel actually supported Iran with spare parts and technical know-how for their American made weapons to win an ally against Iraq. So I was wondering if their is any truth to this.
Generally speaking, Israel supported Iran during the Iran-Iraq war.
Trita Parsi's book, Treacherous Alliance, talks about this quite a bit. Basically, Israel was running a strategy where it skipped over the core states around it (the ones who mostly didn't want peace with it, sans Egypt and later Jordan) to seek allies in Turkey, Iran/Iraq, etc.. This "Periphery Doctrine" outlasted its usefulness, having been around for decades past the peace with Egypt, though it had its dying breaths right around the Iran-Iraq War.
The strategy, as I said, dictated getting whatever allies possible wherever possible. Israel was simply desperate for people to be on its side. It's notable to mention that prior to 1967, Israel and the United States were not really working together or allies, and Israel had turned to the French. But in the region, Israel was alone, and it wanted some cooperative countries to work with. Seeing Iran as a natural ally of Israel, especially given its contest with the Arab world, Israel saw a chance to align with it under the Shah. But even after the Revolution, Israel believed the same opportunity existed, seeing Iran's hostility to the Arab states as continuing.
When Iraqi troops first entered Iran, Israeli officials floated the idea of aiding Iran if it dropped its opposition to Israel's existence to an Israeli paper, and moved swiftly to organize assistance for Iran covertly. Israel spent a lot of effort trying to convince the United States (under Carter, first) to intervene on behalf of Iran. Israel primarily focused on the Iranian army, hoping that if it could influence them to like Israel, then it would alter the regime's policy as well to make it more Israel-friendly. During the Iran-Iraq war, Israel targeted the Iraqi Osirak reactor, expected to be making nuclear material for WMDs, only one month after a reported meeting between Israeli and Iranian officials on the reactor. Iran even agreed, it is suspected, to allow Israeli planes to land in Iran if there were an emergency of any kind. Israel still supplied weapons to Iran during the war, hoping that this would create goodwill for later.
Unfortunately, it did not create goodwill. Once Iran and Iraq stopped their war, Israel was once again cast aside by Iran, who saw it as having been a necessary "deal with the devil" during the war but unnecessary afterwards. Their belligerence increased over time, but that's another story.