What does 一不留神 mean ...还写了不少东西，一不留神写了不少军报头条? I get 'take care' or 'be careful' for 留神。

I‘ve seen '一不留神‘ translated as 'accidentally', but this guy did not write his stuff 'accidentally'. It seems to mean 'surprisingly' here. Is that right?

我是1970年入伍的。我主动要求当最艰苦的工程兵，我当兵10年，参与抢险、修路盖房子，还写了不少东西，一不留神写了不少军报头条。

一不留神写了不少军报头条。 Surprisingly, I wrote a lot of lead stories.
留神 means "pay attention"

一不留神 means " not paying attention for just an instance"

In the sentence,  "一不留神" implies " before I notice it" 


  一不留神写了不少军报头条


"Before I noticed it, I had already written many lead articles in Military News"

You could use "Before I noticed it" or "Before I knew it"