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
Japan beats MLB All-Stars 4-1 in final of exhibition series
Sosuke Genda drove in three runs with a bases-clearing triple as Japan beat the MLB All-Stars 4-1 in the final of their six-game exhibition series on Thursday.
Christian Yelich turned out to be a perfect fit in Milwaukee
The ex-Marlins outfielder's first year in Milwaukee couldn't have gone much better, from his MVP-caliber season to his warm embrace by Midwest fans.
DeGrom says ERA should be main Cy Young decision factor
Jacob deGrom reacts to only having 10 wins this season but still being named the NL Cy Young award winner.
Chris Woodward's Rangers staff includes addition of Luis Ortiz as hitting coach
New Rangers manager Chris Woodward's staff will include three returning coaches and add Luis Ortiz as hitting coach.
Blake Snell: Cy Young means the world
Rays pitcher Blake Snell talks about being in the same conversation with Justin Verlander, Corey Kluber and Chris Sale.
Mets' Jacob deGrom rides majors-best 1.70 ERA to NL Cy Young Award
Mets right-hander Jacob deGrom, who led the majors with a 1.70 ERA, won the National League Cy Young Award on Wednesday night.