Officials told the First Minister that Ms Godley "can be outspoken about a number of subject matters" and uses "profanities regularly" on social media.
The comedian's adverts were later dropped by the Scottish Government over "unacceptable" and offensive tweets.
Ms Godley, 60, apologised for their "terrible, horrific undertones" and donated her £12,000 fee to charity.
Her adverts, which ran on TV and social media, were designed to encourage face coverings, testing and vaccination.
But documents published following a Freedom of Information request show ministers were warned her involvement carried risks.
A briefing note for Ms Sturgeon, health secretary Humza Yousaf and Deputy First Minister John Swinney, dated August 29, recommended pushing ahead “with a celebrity-led campaign using Janey Godley in a piece to camera execution”.
The note added: "Ms Godley is supportive of the Covid-19 safety behaviours and is compliant herself.
"She is available to participate next week and she carries an ‘no nonsense, straight-talking’ approach, which appeals to a wide range of people in Scotland, particularly those of a younger age group.
"Ministers should however be aware that Ms Godley can be outspoken about a number of subject matters, including Donald Trump, other political parties, women’s rights and topical stories.
"Ms Godley’s Twitter page carries profanities regularly, as does her social media content. So using Ms Godley does not come without some risk."
The Scottish Government dropped her adverts just days later, on September 9, after past tweets came to light.
In a statement at the time, Ms Godley said: "There are tweets from my past social media that are horridly offensive. I believe in progress, not perfection, and I am far from perfect.
"People have every right to go through my social media and see what values I hold and to find hurtful phrases and statements is shocking. I am deeply sorry to everyone I offended.
"Comedy is no excuse to use disgusting and hurtful words that affect people and I know many of you expected better of me. I apologise for every single word that upset people."
Last month, the comedian revealed she has been diagnosed with ovarian cancer.