Observations of protoplanetary disks have revealed dust rings that are likely due to the presence of pressure bumps in the disk. Because these structures tend to trap drifting pebbles, it has been proposed that pressure bumps may play an important role in the planet formation process. In this paper, we investigate the orbital evolution of a 0.1 M⊕ protoplanet embedded in a pressure bump using 2D hydrodynamical simulations of protoplanetary disks consisting of gas and pebbles. We examine the role of thermal forces generated by the pebble accretion-induced heat release, taking into account the feedback between the luminosity and the eccentricity. We also study the effect of the pebble-scattered flow on the planet’s orbital evolution. Due to the accumulation of pebbles at the pressure bump, the planet’s accretion luminosity is high enough to induce significant eccentricity growth through thermal forces. Accretion luminosity is also responsible for vortex formation at the planet’s position through baroclinic effects, which cause the planet to escape from the dust ring if dust feedback on the gas is neglected. Including the effect of the dust feedback leads to weaker vortices, which enable the planet to remain close to the pressure maximum on an eccentric orbit. Simulations in which the planet mass is allowed to increase as a consequence of pebble accretion result in the formation of giant planet cores with masses in the range of 5–20 M⊕ over ~2 × 104 yr. This occurs for moderate values of the Stokes number, St ≈ 0.01, such that the pebble drift velocity is not too high and the dust ring mass not too small. Our results suggest that pressure bumps mays be preferred locations for the formation of giant planets, but this requires a moderate level of grain growth within the disk.