This seems ambiguous to me. Does it work with facedown damage cards?
"When you are dealt a Damage card with the Ship trait, you may immediately discard that card (before resolving its effect). Then, discard this Upgrade card."
Note that it does not say "face up" in the card text. Presumably, I could look at what's printed on the face of a damage card dealt facedown, and if it's a Ship trait, I can discard it if it could be deadly to me upon some later game effect causing it to be turned face up.
Realistically, it seems like "face up" should be a part of this card's text, and I feel like its intent is to be relevant only to face up cards. But the RAW/RAI debate has bumped up against my poor lawyering of X-Wing card text in the past, and I honestly don't know what the correct interpretation is.