If these are the goblins i think you're talking about, then it will pull you into a cutscene when the main gate goblins spot you to have the "entering the goblin camp" conversation that will set whether the camp will be hostile to you or not. But, if you already are in combat with that group and then the main gate goblins spot you, it pulls you into a cutscene and then immediately cancels it (as though you had hit the "attack" conversation option) and you are treated as the aggressor, which means that when you kill them it counts as breaking your oath.
It's the one-two combo of clumsy coding and sweaty rules nitpicking that will break your oath every time. We've tried to tell larian about it, but for all their talk about removing of harsh rules to make things easier and more fun, this seems to be the thing they won't budge on.