A four-divergence term $\partial_\mu K^\mu$ when added to a Lagrangian, the action changes as $$S\to S^\prime=S+\int_R d^4x \partial_\mu K^\mu\tag{1}$$ where $R$ is a region of spacetime. Using Gauss' theorem, the term $\int_R d^4x \partial_\mu K^\mu$ can be converted to a surface integral $$\int_{\partial R} d\sigma_\mu K^\mu$$ where $\partial R$ represents the boundary of $R$. Now consider a pure Yang-Mills action $$S=-\int d^4x~ \frac{1}{4}G_{\mu\nu}^a G^{\mu\nu a}.$$ We add to it a term $\int_R d^4x \partial_\mu K^\mu$ where $K^\mu$ has the form $$K^\mu=\frac{1}{16\pi^2}\epsilon^{\mu\nu\lambda\rho}A_\nu^a\Big(G^a_{\lambda\rho}+\frac{g}{3}f^{bca}A_\lambda^b A_\rho^c\Big).$$ Here, $G_{\mu\nu}^a=\partial_\mu A_\nu^a-\partial_\nu A_\mu^a+gf^{abc}A_\mu^b A_\nu^c$ denotes the gluon field strength tensor, $A_\mu^a$ are the gluon gauge fields and $a,b,c$ denote the color index. Therefore, the action changes to \begin{eqnarray}S\to S^\prime &=& S+\int_R d^4x \partial_\mu K^\mu\\ &=& S+\int_{\partial R} d\sigma_\mu K^\mu\\ &=& S+\frac{1}{16\pi^2}\epsilon^{\mu\nu\lambda\rho}\int_{\partial T}d\sigma_\mu A_\nu^a\Big(G^a_{\lambda\rho}+\frac{g}{3}f^{bca}A_\lambda^b A_\rho^c\Big).\end{eqnarray} Now, if we consider pure gauge i.e., a boundary condition of the form $A_\mu^a\neq 0$ but $G_{\mu\nu}^a=0$ at $\partial R$, we see that the action changes by a nonzero amount $$S^\prime-S=\frac{g}{48\pi^2}\epsilon^{\mu\nu\lambda\rho}f^{bca}\int_{\partial R}d\sigma_\mu A_\nu^a A_\lambda^b A_\rho^c\neq 0.$$
Question Does this mean that the action can change even if a four-divergence is added to the Lagrangian?