Skip to content

Commit 8d7d347

Browse files
committed
pin bicep version in CI
Signed-off-by: Gerd Oberlechner <[email protected]>
1 parent 49010c2 commit 8d7d347

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

action.yml

+23-19
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,35 @@ inputs:
1111
description: 'Azure CLI Version to install'
1212
required: false
1313
default: "latest"
14+
bicep_version:
15+
description: 'Bicep Version to install'
16+
required: false
17+
default: "0.33.93"
1418
runs:
1519
using: "composite"
1620
steps:
1721
- name: 'install azure-cli'
1822
shell: bash
1923
env:
2024
AZ_VER: ${{ inputs.version }}
25+
BICEP_VER: ${{ inputs.bicep_version }}
2126
run: |
22-
if [[ "${AZ_VER}" == "latest" ]]; then
23-
# If AZ_VER == latest, then don't bother installing a specific version of az
24-
exit 0
27+
if [[ "${AZ_VER}" != "latest" ]]; then
28+
sudo mkdir -p /etc/apt/keyrings
29+
curl -sLS https://packages.microsoft.com/keys/microsoft.asc |
30+
gpg --dearmor | sudo tee /etc/apt/keyrings/microsoft.gpg > /dev/null
31+
sudo chmod go+r /etc/apt/keyrings/microsoft.gpg
32+
AZ_DIST=$(lsb_release -cs)
33+
echo "Types: deb
34+
URIs: https://packages.microsoft.com/repos/azure-cli/
35+
Suites: ${AZ_DIST}
36+
Components: main
37+
Architectures: $(dpkg --print-architecture)
38+
Signed-by: /etc/apt/keyrings/microsoft.gpg" | sudo tee /etc/apt/sources.list.d/azure-cli.sources
39+
sudo apt-get update
40+
# Obtain the currently installed distribution
41+
AZ_DIST=$(lsb_release -cs)
42+
# Install a specific version
43+
sudo apt-get install azure-cli=${AZ_VER}-1~${AZ_DIST} --allow-downgrades
2544
fi
26-
sudo mkdir -p /etc/apt/keyrings
27-
curl -sLS https://packages.microsoft.com/keys/microsoft.asc |
28-
gpg --dearmor | sudo tee /etc/apt/keyrings/microsoft.gpg > /dev/null
29-
sudo chmod go+r /etc/apt/keyrings/microsoft.gpg
30-
AZ_DIST=$(lsb_release -cs)
31-
echo "Types: deb
32-
URIs: https://packages.microsoft.com/repos/azure-cli/
33-
Suites: ${AZ_DIST}
34-
Components: main
35-
Architectures: $(dpkg --print-architecture)
36-
Signed-by: /etc/apt/keyrings/microsoft.gpg" | sudo tee /etc/apt/sources.list.d/azure-cli.sources
37-
sudo apt-get update
38-
# Obtain the currently installed distribution
39-
AZ_DIST=$(lsb_release -cs)
40-
# Install a specific version
41-
sudo apt-get install azure-cli=${AZ_VER}-1~${AZ_DIST} --allow-downgrades
45+
az bicep install --version ${BICEP_VER}

0 commit comments

Comments
 (0)