generated from PSModule/Template-Action
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.yml
More file actions
109 lines (106 loc) · 4.2 KB
/
action.yml
File metadata and controls
109 lines (106 loc) · 4.2 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: GitHub-Script (by PSModule)
description: A GitHub Action used for running a PowerShell script that uses the GitHub PowerShell module
author: PSModule
branding:
icon: upload-cloud
color: white
inputs:
Name:
description: The name of the action.
required: false
default: GitHub-Script
Script:
description: The script to run. Can be inline, multi-line or a path to a script file.
required: false
Token:
description: Log in using an Installation Access Token (IAT).
required: false
default: ${{ github.token }}
ClientID:
description: Log in using a GitHub App, using the App's Client ID and Private Key.
required: false
PrivateKey:
description: Log in using a GitHub App, using the App's Client ID and Private Key.
required: false
KeyVaultKeyReference:
description: Log in using a GitHub App, using the App's Client ID and KeyVault Key Reference.
required: false
Debug:
description: Enable debug output for the whole action.
required: false
default: 'false'
Verbose:
description: Enable verbose output for the whole action.
required: false
default: 'false'
Version:
description: Specifies the version of the GitHub module to be installed. The value must be an exact version.
required: false
Prerelease:
description: Allow prerelease versions if available.
required: false
default: 'false'
ShowInfo:
description: Show information about the environment.
required: false
default: 'true'
ShowInit:
description: Show information about the initialization.
required: false
default: 'false'
ShowOutput:
description: Show the output of the script.
required: false
default: 'false'
ErrorView:
description: Configure the PowerShell `$ErrorView` variable. You can use full names ('NormalView', 'CategoryView', 'ConciseView', 'DetailedView'). It matches on partials.
required: false
default: 'NormalView'
WorkingDirectory:
description: The working directory where the script will run from.
required: false
default: '.'
PreserveCredentials:
description: Preserve credentials after script execution. If false, disconnects GitHub contexts and CLI using Disconnect-GitHubAccount.
required: false
default: 'true'
outputs:
result:
description: The output of the script as a JSON object. To add outputs to `result`, use `Set-GitHubOutput`.
value: ${{ steps.RunGitHubScript.outputs.result }}
runs:
using: composite
steps:
- name: ${{ inputs.Name }}
shell: pwsh
id: RunGitHubScript
working-directory: ${{ inputs.WorkingDirectory }}
env:
PSMODULE_GITHUB_SCRIPT_INPUT_Name: ${{ inputs.Name }}
PSMODULE_GITHUB_SCRIPT_INPUT_Token: ${{ inputs.Token }}
PSMODULE_GITHUB_SCRIPT_INPUT_ClientID: ${{ inputs.ClientID }}
PSMODULE_GITHUB_SCRIPT_INPUT_PrivateKey: ${{ inputs.PrivateKey }}
PSMODULE_GITHUB_SCRIPT_INPUT_KeyVaultKeyReference: ${{ inputs.KeyVaultKeyReference }}
PSMODULE_GITHUB_SCRIPT_INPUT_Debug: ${{ inputs.Debug }}
PSMODULE_GITHUB_SCRIPT_INPUT_Verbose: ${{ inputs.Verbose }}
PSMODULE_GITHUB_SCRIPT_INPUT_Version: ${{ inputs.Version }}
PSMODULE_GITHUB_SCRIPT_INPUT_ShowInit: ${{ inputs.ShowInit }}
PSMODULE_GITHUB_SCRIPT_INPUT_ShowInfo: ${{ inputs.ShowInfo }}
PSMODULE_GITHUB_SCRIPT_INPUT_ShowOutput: ${{ inputs.ShowOutput }}
PSMODULE_GITHUB_SCRIPT_INPUT_Prerelease: ${{ inputs.Prerelease }}
PSMODULE_GITHUB_SCRIPT_INPUT_ErrorView: ${{ inputs.ErrorView }}
PSMODULE_GITHUB_SCRIPT_INPUT_PreserveCredentials: ${{ inputs.PreserveCredentials }}
run: |
# ${{ inputs.Name }}
$ErrorView = $env:PSMODULE_GITHUB_SCRIPT_INPUT_ErrorView
$DebugPreference = $env:PSMODULE_GITHUB_SCRIPT_INPUT_Debug -eq 'true' ? 'Continue' : 'SilentlyContinue'
$VerbosePreference = $env:PSMODULE_GITHUB_SCRIPT_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue'
try {
${{ github.action_path }}/src/init.ps1
${{ github.action_path }}/src/info.ps1
${{ inputs.Script }}
${{ github.action_path }}/src/outputs.ps1
}
finally {
${{ github.action_path }}/src/clean.ps1
}