Magnetic skyrmions, mainly found in a magnetic material with the Dzyaloshinskii-Moriya interaction induced by the spin-orbit coupling, are one of the most promising candidates for future spintronics applications. Due to the demand for device miniaturization, real devices are usually modelled upon confined geometries with edge boundaries. Within this arena, it is essential to manipulate the dynamics of a skyrmion close to the track edge. In this work, we observe two distinct situations where a current-driven skyrmion propagation passes through or pinned at a notch at one of the edges according to the applied current density. This observation can be exploited together with the asymmetrical edge potential energy profile for a skyrmion diode. The phenomenon is explained by a simple model based on the collective coordinates for skyrmion’s motion in conjunction with an energy surface corresponding to the boundary force and spin-torque. This work provides an important avenue to design skyrmion-based logic device such as a diode element by manipulating potential energies through the device shape.