Alan Weir, 26, used his security card to open Prestonfield House Hotel's cellar and took 15 bottles of wine and spirits.
He handed in his notice later that night but was caught on CCTV and tracked down by the police.
Sheriff John Horsburgh QC told Weir: "The value of the goods you stole was very significant here and your record shows you have several previous convictions for crimes of dishonesty.
"The only appropriate disposal is one which involves custody."
He added that the sentence would have been eight months if Weir had not pled guilty.
At an earlier hearing fiscal depute Aidan Higgins told Edinburgh Sheriff Court the theft came to light three days later during a standard check and Weir was easily identified when CCTV footage was checked.
Mr Higgins said when police visited at his home they were directed to a cupboard where the alcohol was being stashed.
Weir, of Gilmerton Dykes Avenue, Edinburgh, admitted forcing open a lockfast wine cellar by means of a keycard and stealing a quantity of alcohol on 3 January this year at the hotel.
The court heard Weir committed the offence after going through a bad time due to an injury to his eye and also after his partner's infidelity.
His defence agent Angus McLennan said: "This matter now is a fairly isolated incident having avoided offending behaviour for some time and it has cost his employment.
"It seems to be a reaction to discovering his partner's infidelity."
Mr McLennan added that Weir was back in employment and offered to pay a financial penalty or carry out community service as an alternative to custody.