AP photo by Ross D. Franklin / Atlanta Braves third baseman Austin Riley, right, celebrates his three-run home run against the Arizona Diamondbacks with Marcell Ozuna during the seventh inning of Wednesday's game in Phoenix. Riley has five homers in his past eight games.

PHOENIX — Austin Riley made what he called a minor mechanical adjustment at the plate two weeks ago that has led to major success.

The Atlanta Braves third baseman said assistant hitting coach Bobby Magallanes "noticed my posture when I was loading, I was turning my shoulders when I was trying to swing and they were facing second base.

"We cleaned that up back to where I am more square to the plate. It's allowed me stay on more balls. Whether I get fooled a little bit, I am still able to put a decent swing on it."

His 439-foot, three-run homer in the seventh inning broke open Atlanta's 6-0 victory over the Arizona Diamondbacks in Wednesday's series finale as the Braves avoided their first three-game losing streak of the season.

It was Riley's fifth homer in the past eight games and 13th of the year.

"It's good to bounce back after the last couple of days and play a game like that. That is more indicative of what we are capable of," said Atlanta manager Brian Snitker, whose team lost leads in the first two games of the three-game set, including Tuesday night's 8-7 defeat in 10 innings after the Braves led 6-2 after 6 1/2 innings.

Atlanta right-hander Kyle Wright threw six scoreless innings Wednesday, when catcher William Contreras had three hits — including two of Atlanta's five doubles. Adam Duvall, Michael Harris II and Guillermo Heredia had the others.

Wright (5-3) received more than three runs of support for the first time this season, giving up three hits and five walks with five strikeouts in his seventh quality start. The Braves had scored 16 runs when he was in the game in his previous nine starts.

"The last couple of outings he has been grinding his butt off," Riley said of Wright. "He's a stud."

Atlanta recorded its third combined shutout of the season, the second in which Wright has started.

"It was pretty ugly," Wright said. "It was bend don't break, find a way to make some pitches and get out of it. You are always one pitch away. I feel confident I can get a ground ball when I need it or a strikeout when I need it. That's a big part of it."

Atlanta's five doubles — all with an exit velocity of at least 105 mph — came in the first four innings off Madison Bumgarner (2-4), who had won his previous eight decisions against the Braves.

"There was a couple times it crossed my mind just to turn around and throw it in the gap and save time, start the inning off with a runner on second, because that's what we ended up doing anyway," said Bumgarner, who gave up seven hits and two walks and struck out six in six innings.

Atlanta first baseman Matt Olson had his doubles streak broken after hitting five in the previous three games, but he still leads the major leagues with 23 doubles this season and is on pace for 73.

"It's real," Snitker said.

Boston outfielder Earl Webb holds the major-league record, 67, set in 1931. Only six players have hit 60 doubles in a season, the last when Hall of Famers Joe Medwick and Charlie Gehringer did it in 1936. The Braves' franchise record is 51, by Hall of Famer Hugh Duffy in 1984.

Arizona was shut out for the fifth time this year.

Ketel Marte singled and walked twice while extending his career-long hitting streak to 14 games for the Diamondbacks, who did not have a hit in the last five innings and got only three runners as far as second base.

David Peralta doubled to open the bottom of the fourth but got no further, and Wright induced a double-play grounder from Christian Walker after two one-out walks in the fifth. Peralta's double was Arizona's final hit.

Contreras drove in Dansby Swanson with his first double in the first inning, and Harris doubled in Duvall in the second for a 2-0 lead.

"Each inning was different," Bumgarner said. "Just trying to find a way to talk yourself into being able to put the ball where it's supposed to go. Sometimes it just happens."

Atlanta, last year's World Series winner, is the four-time reigning champion in the National League East, but at 24-27, the Braves are 10 1/2 games behind the division-leading New York Mets (35-17). That's furthest the Braves have been out of first place since finishing the 2017 season 25 games behind the Washington Nationals.

Atlanta was eight games out of first place and five games under .500 last June 16 before rebounding. The team is 7-6 so far during a stretch in which it will play 29 consecutive games against teams currently with a losing record.

Star slugger Ronald Acuña Jr. (general soreness) was held out of the starting lineup Wednesday as Atlanta prepares to begin a four-game series against the Colorado Rockies — where the altitude is high and the outfield is big — on Thursday.

Left-handed relief pitcher Tyler Matzek (shoulder inflammation) was eligible to return from the injured list Wednesday but has not begun a throwing program.