DETROIT—Despite a computer chip shortage that temporarily closed some of its factories, General Motors made a healthy $2.8 billion net profit in the second quarter. The earnings came even though GM plants cranked out 200,000 fewer vehicles than they did during the same period in 2019, the last comparable quarter before the COVID-19 pandemic. The automaker told the same story as competitors Ford, Stellantis, and others, saying that high prices and strong demand for expensive pickup trucks and luxury SUVs overcame inventory shortages. GM also boosted its net income guidance for the full year to $7.7 billion and $9.2 billion, and pretax earnings of $11.5 billion to $13.5 billion. It had been $10 billion to $11 billion. GM executives said Wednesday that they expect tight inventory and high prices to continue through the year as the chip shortage lingers into 2022. CEO Mary Barra cautioned that the fast-spreading coronavirus delta …