|
1 | 1 | # GitHub-Script |
2 | 2 |
|
3 | | -A GitHub Action used for running a PowerShell Script that uses the GitHub PowerShell module. |
| 3 | +A GitHub Action for running a PowerShell script that uses the GitHub PowerShell module. |
4 | 4 |
|
5 | | -For more information on the available functions and automatic loaded variables, see the |
6 | | -[GitHub PowerShell module documentation](https://psmodule.io/GitHub) |
| 5 | +For more information on available functions and automatically loaded variables, see the |
| 6 | +[GitHub PowerShell module documentation](https://psmodule.io/GitHub). |
7 | 7 |
|
8 | 8 | ## Usage |
9 | 9 |
|
10 | 10 | ### Inputs |
11 | 11 |
|
12 | | -| Name | Description | Required | Default | |
13 | | -| - | - | - | - | |
14 | | -| `Script` | The script to run. Can be inline, multi-line or a path to a script file. | false | | |
15 | | -| `Token` | Log in using an Installation Access Token (IAT). | false | `${{ github.token }}` | |
16 | | -| `ClientID` | Log in using a GitHub App, using the App's Client ID and Private Key. | false | | |
17 | | -| `PrivateKey` | Log in using a GitHub App, using the App's Client ID and Private Key. | false | | |
18 | | -| `Debug` | Enable debug output. | false | `'false'` | |
19 | | -| `Verbose` | Enable verbose output. | false | `'false'` | |
20 | | -| `Version` | Specifies the version of the GitHub module to be installed. The value must be an exact version. | false | | |
21 | | -| `Prerelease` | Allow prerelease versions if available. | false | `'false'` | |
22 | | -| `ShowOutput` | Show the output of the script. | false | `'false'` | |
23 | | -| `WorkingDirectory` | The working directory where the script will run from. | false | `${{ github.workspace }}` | |
| 12 | +| Name | Description | Required | Default | |
| 13 | +|-------------------|-------------------------------------------------------------------------------------------|----------|------------------------------| |
| 14 | +| `Script` | The script to run. Can be inline, multi-line, or a path to a script file. | false | | |
| 15 | +| `Token` | Log in using an Installation Access Token (IAT). | false | `${{ github.token }}` | |
| 16 | +| `ClientID` | Log in using a GitHub App, with the App's Client ID and Private Key. | false | | |
| 17 | +| `PrivateKey` | Log in using a GitHub App, with the App's Client ID and Private Key. | false | | |
| 18 | +| `Debug` | Enable debug output. | false | `'false'` | |
| 19 | +| `Verbose` | Enable verbose output. | false | `'false'` | |
| 20 | +| `Version` | Specifies the exact version of the GitHub module to install. | false | | |
| 21 | +| `Prerelease` | Allow pre-release versions if available. | false | `'false'` | |
| 22 | +| `ShowOutput` | Show the script's output. | false | `'false'` | |
| 23 | +| `WorkingDirectory`| The working directory where the script runs. | false | `${{ github.workspace }}` | |
24 | 24 |
|
25 | 25 | ### Outputs |
26 | 26 |
|
27 | | -| Name | Description | |
28 | | -| - | - | |
29 | | -| `result` | The output of the script as a JSON object. To add outputs to `result`, use `Set-GitHubOutput`. | |
| 27 | +| Name | Description | |
| 28 | +|----------|------------------------------------------------------------------------------------------------------| |
| 29 | +| `result` | The script output as a JSON object. To add outputs to `result`, use `Set-GitHubOutput`. | |
30 | 30 |
|
31 | | -To use the outputs in a subsequent step, you can use the following syntax: |
| 31 | +To use the outputs in a subsequent step, reference them as follows: |
32 | 32 |
|
33 | 33 | ```yaml |
34 | 34 | - uses: PSModule/GitHub-Script@v1 |
@@ -56,7 +56,7 @@ To use the outputs in a subsequent step, you can use the following syntax: |
56 | 56 |
|
57 | 57 | #### Example 1: Run a GitHub PowerShell script file |
58 | 58 |
|
59 | | -Run a script (`scripts/main.ps1`) that uses the GitHub PowerShell module, authenticated using the `GITHUB_TOKEN`. |
| 59 | +Runs a script (`scripts/main.ps1`) that uses the GitHub PowerShell module, authenticated using the `GITHUB_TOKEN`. |
60 | 60 |
|
61 | 61 | ```yaml |
62 | 62 | jobs: |
@@ -112,6 +112,7 @@ The `Script` input supports the following formats: |
112 | 112 | > Using `tests\info.ps1` is PowerShell syntax for calling a function under a specific module, i.e. `Microsoft.PowerShell.Management\Get-ChildItem`. |
113 | 113 | > |
114 | 114 |
|
| 115 | + |
115 | 116 | > [!TIP] |
116 | 117 | > Use script files instead of inline scripts for better tooling support and linting capabilities. The PowerShell extension for Visual Studio Code and |
117 | 118 | > PowerShell linters like PSScriptAnalyzer will work natively with script files. |
|
0 commit comments