Skip to content

Commit 158b906

Browse files
committed
Add check for Microsoft repository before installation of OMI
1 parent 9ea87d9 commit 158b906

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/copilot-setup-steps.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,19 @@ jobs:
7171
# Update package list
7272
sudo apt-get update
7373
74+
# Check if Microsoft repository is already added, if not add it
75+
if ! grep -q "packages.microsoft.com" /etc/apt/sources.list /etc/apt/sources.list.d/* 2>/dev/null; then
76+
echo "Adding Microsoft repository..."
77+
# Add Microsoft's GPG key and repository
78+
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
79+
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-$(lsb_release -cs)-prod $(lsb_release -cs) main"
80+
81+
# Update package list again after adding the new repo
82+
sudo apt-get update
83+
else
84+
echo "Microsoft repository already configured, skipping..."
85+
fi
86+
7487
# Install OMI (Open Management Infrastructure) which provides libmi
7588
sudo apt-get install -y omi
7689

0 commit comments

Comments
 (0)