Group actions on principal bundles and invariance conditions for gauge fields