Updated

Jeff Locke fired seven shutout innings to outduel Lucas Harrell, while Pedro Alvarez's solo homer provided the only scoring in the Pittsburgh Pirates' 1-0 victory over the Houston Astros at PNC Park.

Locke (4-1) yielded just three hits and two walks while striking out four to record his fourth straight winning decision. The young lefty hasn't lost in eight starts since dropping his season debut at the Los Angeles Dodgers on Apr. 7.

"He didn't give up anything," Pirates manager Clint Hurdle said of Locke. "He was able to put a foot down, get balls on the ground when we needed them."

Mark Melancon and Jason Grilli tossed a scoreless inning each to finish off the shutout, with Grilli notching his MLB-leading 17th save with a 1-2-3 ninth.

Harrell (3-5) held Pittsburgh to four hits and a walk while recording 13 outs on the ground over seven innings, but was dealt a hard-luck defeat when Alvarez connected on his eighth homer of the season in the bottom of the fifth.

"It was vintage Luke Harrell," said Astros manager Bo Porter. "It was ground ball after ground ball, it was efficient [with his] pitch count. "We just didn't score any runs."

The blast staked the Pirates to their eighth win in 10 outings after taking the rubber match of this three-game set.

Harrell also had one of a mere three hits for Houston, which has now lost eight of 10.

Both pitchers were in top form for much of the afternoon, with the game's first hit not occurring until Houston's Carlos Corporan singled to lead off the top of the fifth inning. Locke had issued only a pair of walks prior to the hit.

Harrell was even better early on, setting down 13-of-14 Pittsburgh hitters out of the gate until Alvarez stepped to the plate with one out in the bottom of the fifth.

The power-hitting third baseman, who drew a walk in his initial at-bat for the only Pirate to reach base to that point, lined a first-pitch sinker just inside the left-field foul pole to break the scoreless deadlock.

"I knew that it would be fair," said Alvarez. "I didn't know if it would carry as much as it did."

Pittsburgh had a chance to add to the margin an inning later, when Travis Snider doubled and Gaby Sanchez singled two batters afterward. However, Houston center fielder Brandon Barnes gunned down Snider attempting to score to keep it a 1-0 result.

Still, Locke made the lead stand by allowing only one Astro to move into scoring position over his terrific stint. That came when Harrell opened the sixth with a single and took second on a Barnes sacrifice bunt, but Locke retired Jose Altuve and J.D. Martinez to prevent any damage.

The Astros managed just one baserunner the rest of the way, with Chris Carter singling off Locke to start the seventh. He was eventually erased on an inning-ending double play.

Game Notes

Pirates center fielder Andrew McCutchen was scratched from the starting lineup due to soreness in his right knee, while Astros shortstop Ronny Cedeno was held out with a sinus infection ... Locke has posted a 1.70 ERA over his last six starts and matched the longest outing of his career, having also tossed seven shutout frames to best St. Louis on Apr. 28 ... The Astros haven't won a series on the road since their first of the season, when they took two of three matchups at Seattle from Apr. 8-10 ... Pittsburgh is now 10-4 against American League clubs at PNC Park since the start of last season.