On this page
article
pin-your-bicep
Install and pin a specific Bicep CLI version on your GitHub Actions runner
pin-your-bicep
Installs and pins a specific Bicep CLI version on the runner, then adds it to PATH so subsequent steps can use bicep directly. If the requested version is already present on the agent, the download is skipped.
This action does not require authentication.
Usage
- uses: ipmhubio/ipm-actions/.github/actions/pin-your-bicep@v1
with:
version: 'latest' # Optional: specific version or 'latest' (default: latest)
Inputs
| Input | Required | Default | Description |
|---|---|---|---|
version |
No | latest |
Bicep version to install. Accepts latest or a specific version with or without the v prefix (e.g. 0.38.3 or v0.38.3). |
Outputs
| Output | Description |
|---|---|
installed |
true if Bicep was downloaded; false if the requested version was already present. |
resolved_version |
The actual version that was installed (normalized, no leading v). |
path |
Install directory added to PATH, if a download occurred. |
Supported Platforms
| OS | Architectures |
|---|---|
| Ubuntu | x64, arm64 |
| macOS | x64, arm64 |
| Windows | x64, arm64 |
Examples
Install the latest Bicep release
- name: Pin Bicep
uses: ipmhubio/ipm-actions/.github/actions/pin-your-bicep@v1
- name: Compile Bicep template
run: bicep build ./main.bicep
Pin a specific Bicep version
- name: Pin Bicep 0.38.3
uses: ipmhubio/ipm-actions/.github/actions/pin-your-bicep@v1
with:
version: '0.38.3'
Use outputs to log the installed version
- name: Pin Bicep
id: bicep
uses: ipmhubio/ipm-actions/.github/actions/pin-your-bicep@v1
- name: Log Bicep version
run: echo "Installed Bicep ${{ steps.bicep.outputs.resolved_version }}"
Combine with IPM sync in a Bicep deployment workflow
name: Deploy Bicep infrastructure
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Pin Bicep
uses: ipmhubio/ipm-actions/.github/actions/pin-your-bicep@v1
with:
version: '0.38.3'
- name: Sync IPM packages
uses: ipmhubio/ipm-actions/.github/actions/ipm-sync@v1
with:
working-directory: ./infrastructure
sync-mode: Clean
env:
IPM_CLIENT_SECRETS: ${{ secrets.IPM_CLIENT_SECRETS }}
- name: Build Bicep
run: bicep build ./infrastructure/main.bicep
The action checks if the requested version is already on the agent's `PATH` before downloading. On self-hosted runners with a pre-installed Bicep, the download step will be skipped automatically.