In order to attain octet configuration, the atoms share, lose or gain electrons, then its atomic mass
Does not change
The loss or gain of electrons does not change the atomic mass because the mass of electrons is much lighter than the mass of protons and neutrons.
So, the mass of an electron is not considered for atomic mass.
Atomic mass=mass of nucleus = mass of protons + mass of neutrons.