-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaction.yml
More file actions
81 lines (75 loc) · 2.54 KB
/
action.yml
File metadata and controls
81 lines (75 loc) · 2.54 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Install PowerShell
description: |
Install a specific version, or the latest stable version, of PowerShell Core
on any GitHub runner (Linux, macOS, Windows).
Skips the install if the requested version is already present.
author: PSModule
branding:
icon: terminal
color: purple
inputs:
Version:
description: |
PowerShell version to install (e.g. `7.4.1` or `7.4.0-preview.5`).
Defaults to install the latest stable release.
Prerelease versions are supported (e.g. `7.4.0-preview.5`, `7.5.0-rc.1`).
required: false
default: 'latest'
Prerelease:
description: |
Install a prerelease version of PowerShell.
When `true` and `Version` is `latest`, installs the latest prerelease.
Similar to the `-Prerelease` switch on `Install-PSResource`.
required: false
default: 'false'
Token:
description: |
Token used for GitHub API calls.
Defaults to github.token. Set to an empty string for anonymous API access.
required: false
default: ${{ github.token }}
Host:
description: |
GitHub host used by gh CLI for API calls.
Use github.com for GitHub.com or your GHES hostname.
required: false
default: github.com
runs:
using: composite
steps:
- name: Install PowerShell
if: runner.os == 'Linux'
shell: bash
working-directory: ${{ github.action_path }}
env:
REQUESTED_VERSION: ${{ inputs.Version }}
PRERELEASE: ${{ inputs.Prerelease }}
GITHUB_TOKEN: ${{ inputs.Token }}
GH_TOKEN: ${{ inputs.Token }}
GH_ENTERPRISE_TOKEN: ${{ inputs.Token }}
GH_HOST: ${{ inputs.Host }}
run: bash ./scripts/linux/install.sh
- name: Install PowerShell
if: runner.os == 'macOS'
shell: bash
working-directory: ${{ github.action_path }}
env:
REQUESTED_VERSION: ${{ inputs.Version }}
PRERELEASE: ${{ inputs.Prerelease }}
GITHUB_TOKEN: ${{ inputs.Token }}
GH_TOKEN: ${{ inputs.Token }}
GH_ENTERPRISE_TOKEN: ${{ inputs.Token }}
GH_HOST: ${{ inputs.Host }}
run: bash ./scripts/macos/install.sh
- name: Install PowerShell
if: runner.os == 'Windows'
shell: powershell
working-directory: ${{ github.action_path }}
env:
REQUESTED_VERSION: ${{ inputs.Version }}
PRERELEASE: ${{ inputs.Prerelease }}
GITHUB_TOKEN: ${{ inputs.Token }}
GH_TOKEN: ${{ inputs.Token }}
GH_ENTERPRISE_TOKEN: ${{ inputs.Token }}
GH_HOST: ${{ inputs.Host }}
run: ./scripts/windows/install.ps1