forked from powershell-devops/powershell-devops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
42 lines (39 loc) · 1.56 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Install powershell-devops Module
description: Installs the powershell-devops module from the PowerShell Gallery
author: smokedlinq
branding:
icon: play
color: green
inputs:
required-version:
description: 'Optional required version to install. If not provided, will install the latest version. Example: 0.0.7'
required: false
minimum-version:
description: 'Optional minimum version to install. If not provided, will install the latest version. Example: 0.0.7'
required: false
maximum-version:
description: 'Optional maximum version to install. If not provided, will install the latest version. Example: 0.0.7'
required: false
runs:
using: composite
steps:
- name: Install-Module powershell-devops
shell: pwsh
env:
# https://github.com/actions/runner/issues/665
INPUT_REQUIRED_VERSION: ${{ inputs.required-version }}
INPUT_MINIMUM_VERSION: ${{ inputs.minimum-version }}
INPUT_MAXIMUM_VERSION: ${{ inputs.maximum-version }}
run: |
if ($env:INPUT_REQUIRED_VERSION) {
Install-Module powershell-devops -RequiredVersion $env:INPUT_REQUIRED_VERSION -Force
} else {
$InstallModuleParameters = @{}
if ($env:INPUT_MINIMUM_VERSION) {
$InstallModuleParameters.MinimumVersion = $env:INPUT_MINIMUM_VERSION
}
if ($env:INPUT_MAXIMUM_VERSION) {
$InstallModuleParameters.MaximumVersion = $env:INPUT_MAXIMUM_VERSION
}
Install-Module powershell-devops -Force -AllowClobber @InstallModuleParameters
}