SAN FRANCISCO -- The Arizona Diamondbacks are costing themselves crucial late-season wins by missing scoring opportunities.
Two straight shutouts by the San Francisco Giants and Arizona dropped into a first-place tie with Colorado in the NL West.
Pinch-hitter Gorkys Hernandez singled home the winning run with one out in the ninth inning, lifting the Giants to a 1-0 win on Tuesday night.
"We've got a long way to go. We can't win it today and we can't win it tomorrow," manager Torey Lovullo said. "We've got to play good baseball for another 30-plus days. Our guys are battle-tested. They're smart, they're aggressive, they're tough, and I want them to remember that."
Steven Duggar scored the deciding run moments after what looked like a potentially serious injury. Duggar stayed in the game after making a headfirst slide back into second on Nick Hundley's single after he initially rounded second. Duggar was seen testing his bruised left shoulder, which will be re-evaluated Wednesday.
"I was out there, he was in pain," manager Bruce Bochy said. "He said, `I'm staying in this game."
Going back to Sunday's 5-2 win against Seattle, the Diamondbacks have gone 23 innings without scoring, shut out for the seventh time this season.
San Francisco earned its 12th shutout and extended its winning streak to four games.
"All we can do right now is just kind of put our head down and try to go win today," ace pitcher Madison Bumgarner said. "... We're not going to look behind, we're not going to look ahead. We're going stay focused on that day and then see where we're at at the end of it. It's no secret a lot of stuff has to go right and a lot of stuff has to go wrong."
Brad Ziegler (1-6) walked Duggar with one out, taking the loss for his first decision since returning to the Diamondbacks in a trade from Miami before the deadline.
Will Smith (2-2) pitched a 1-2-3 ninth for the win.
Diamondbacks reliever Archie Bradley allowed consecutive one-out walks in the eighth then manager Torey Lovullo turned to Andrew Chafin one out later and he retired Brandon Crawford on a groundout with runners on second and third.
Arizona failed to take advantage of a break in the seventh when Giants left fielder Austin Slater flubbed a lazy fly ball by Jon Jay then slid on his backside trying to retrieve the ball for a three-base error.
Bumgarner allowed four hits, five strikeouts and four walks. He has surrendered three or fewer runs in 13 of his 16 starts, but had nothing to show for this one. He was coming off eight strong innings in which he gave up one earned run to beat the Mets last Thursday.
Buchholz has allowed only one run over his last three starts and 23 innings.
San Francisco has played at least one one-run game in each of its last nine series.
Joe Panik thought he had a two-out double in the third when the play went to review and was overturned in just less than two minutes. He was thrown out at second by center fielder A.J. Pollock and credited with a single.
Diamondbacks: 1B coach Dave McKay was OK after he took a ball to the head during batting practice when it ricocheted about 75 feet off the protective L screen, according to Lovullo. ... Arizona recalled INF/OF Christian Walker from Triple-A Reno to add right-handed hitting depth on the bench and optioned RHP Matt Andriese to Class-A Visalia. Andriese, who also will work out at the team's Salt River Fields facility, will be stretched out to start and the D-backs didn't want to take innings from any potential September call-ups who need innings at Triple-A.
Giants: C Buster Posey is scheduled to return to the Bay Area on Thursday from Vail, Colorado, where he underwent season-ending right hip surgery Monday. Bochy exchanged texts with Posey and said "he's doing great" and is already up and moving around. ... RHP Jeff Samardzija is scheduled for a second opinion on his inflamed pitching shoulder Wednesday from Dr. Tim McAdams at Stanford.
Arizona 13-game winner righty Zack Godley (13-7, 4.59 ERA) is 5-0 with a 4.05 ERA over his last seven road starts and will be opposed in the series finale by standout Giants rookie Dereck Rodriguez (6-1, 2.30 ERA). The right-hander makes his second start since coming off the DL from a strained right hamstring.
More AP MLB: https://apnews.com/tag/MLB and https://twitter.com/AP-Sports
MLB All-Stars pick up first win over Japan
Yadier Molina and J.T. Realmuto both homered Sunday to lead the MLB All-Stars to a 7-3 win over Japan for their first win of the six-game exhibition series.
NL Central offseason preview: Can the Brewers do it again?
Milwaukee seems due for some regression, the Cubs don't figure to throw money at their problems and the Cardinals might be looking to add some star power.
Nobody's more valuable than Mike Trout, but will he be MVP?
Whether or not the Angels superstar wins his third MVP award, his impact on the game transcends any trophy.
Justin Verlander, Kate Upton announce birth of daughter
Justin Verlander and wife Kate Upton welcomed a daughter, Genevieve Upton Verlander, on Wednesday.
Red Sox broadcaster Jerry Remy says he's cancer-free
Boston Red Sox television analyst Jerry Remy tweeted Friday that he is currently cancer-free after being diagnosed with the disease again in August.
Report: Nats ownership struck down Bryce Harper-to-Astros deal at deadline
The proposed deal would have sent three minor league Astros prospects to the Nationals in exchange for Bryce Harper, The Athletic reported Saturday.