-
Notifications
You must be signed in to change notification settings - Fork 7
/
action.yml
84 lines (84 loc) · 2.8 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
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
82
83
84
name: 'Setup scoop'
description: >-
Install apps to Windows runner by scoop,
and update PATH of your workflow.
branding:
icon: 'hard-drive'
color: 'green'
inputs:
install_scoop:
description: 'Install scoop if true (default)'
required: true
default: 'true'
add_extras_bucket:
description: 'This is obsoleted and use `buckets: extras`'
required: true
default: 'false'
add_nonportable_bucket:
description: 'This is obsoleted and use `buckets: nonportable`'
required: true
default: 'false'
scoop_update:
description: 'Call scoop update if true (default)'
required: true
default: 'true'
scoop_checkup:
description: 'Call scoop checkup if true'
required: true
default: 'false'
update_path:
description: >-
Update environment variable PATH for workflow if true (default)
required: true
default: 'true'
buckets:
description: 'Bucket(s) to add, delimit several buckets by white space'
required: false
default: ''
run_as_admin:
description: 'Install scoop with `-RunAsAdmin` or not'
required: false
default: true
apps:
description: 'Apps to be installed'
required: false
default: ''
runs:
using: "composite"
steps:
- name: 'Setup scoop'
shell: pwsh
run: |
if('${{ inputs.install_scoop }}' -eq 'true') {
if('${{ inputs.run_as_admin }}' -eq 'true') {
${{ env.SCRIPTS_PATH }}\install_scoop.ps1 -RunAsAdmin
} else {
${{ env.SCRIPTS_PATH }}\install_scoop.ps1
}
scoop --version
}
if('${{ inputs.update_path }}' -eq 'true') {
Join-Path (Resolve-Path ~).Path "scoop\shims" >> $Env:GITHUB_PATH
}
if('${{ inputs.add_extras_bucket }}' -eq 'true') {
Write-Error 'setup-scoop: `add_extras_bucket`' `
' is now obsoleted,use `buckets` instead.' -ErrorAction Stop
}
if('${{ inputs.add_nonportable_bucket }}' -eq 'true') {
Write-Error 'setup-scoop: `add_nonportable_bucket`' `
'is now obsoleted, use `buckets` instead.' -ErrorAction Stop
}
Write-Host 'setup-scoop: inputs.buckets ${{ inputs.buckets }}'
$param_buckets_string = "${{ inputs.buckets }}"
if ($param_buckets_string) {
${{ env.SCRIPTS_PATH }}\add_buckets.ps1 "$param_buckets_string"
}
if('${{ inputs.scoop_update }}' -eq 'true') {scoop update}
if('${{ inputs.scoop_checkup }}' -eq 'true') {scoop checkup}
Write-Host 'setup-scoop: inputs.apps ${{ inputs.apps }}'
$param_apps_string = "${{ inputs.apps }}"
if ($param_apps_string) {
${{ env.SCRIPTS_PATH }}\install_apps.ps1 "$param_apps_string"
}
env:
SCRIPTS_PATH: ${{ github.action_path }}\scripts