Skip to content

Commit b41e11f

Browse files
Refactor README.md for improved clarity and consistency in script input descriptions and examples
1 parent dc7d1ff commit b41e11f

File tree

1 file changed

+31
-38
lines changed

1 file changed

+31
-38
lines changed

README.md

Lines changed: 31 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ For more information on available functions and automatically loaded variables,
99

1010
### Inputs
1111

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 }}` |
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 }}` |
2424

2525
### Outputs
2626

@@ -51,7 +51,6 @@ To use the outputs in a subsequent step, reference them as follows:
5151
Write-Output $result.Octocat.Image
5252
```
5353
54-
5554
### Examples
5655
5756
#### Example 1: Run a GitHub PowerShell script file
@@ -88,18 +87,16 @@ jobs:
8887
```
8988

9089
> [!IMPORTANT]
91-
> Use `${{ github.action_path }}/<pathToScript.ps1>` if you are creation an action of your own using this action as a step. This will ensure that
92-
> the path to the script is from the calling action, and not the `GitHub-Script` action repo. Using `$env:GITHUB_ACTION_PATH` may have mixed results
93-
> when you nest actions inside one another. The context syntax will be expanded to the correct path when the job is evaluted by GitHub before it is
94-
> processed by the runner.
95-
>
90+
> Use `${{ github.action_path }}/<pathToScript.ps1>` if you are creating an action of your own that uses this action as a step. This ensures
91+
> the path references your action rather than the `GitHub-Script` action repository. Using `$env:GITHUB_ACTION_PATH` can lead to mixed results
92+
> when nesting actions. The context syntax will expand to the correct path when the job is evaluated by GitHub before being processed by the runner.
9693

97-
The `Script` input supports the following formats:
94+
The `Script` input supports these formats:
9895

9996
- Inline script:
10097
- Single-line
10198
- Multi-line
102-
- Path to a script file. (recommended)
99+
- Path to a script file (recommended):
103100
- `scripts/main.ps1`
104101
- `.\scripts\main.ps1`
105102
- `./scripts/main.ps1`
@@ -109,19 +106,16 @@ The `Script` input supports the following formats:
109106
- `. './scripts/main.ps1'`
110107

111108
> [!WARNING]
112-
> Using `tests\info.ps1` is PowerShell syntax for calling a function under a specific module, i.e. `Microsoft.PowerShell.Management\Get-ChildItem`.
113-
>
109+
> Using `tests\info.ps1` is PowerShell syntax for calling a function from a specific module (e.g., `Microsoft.PowerShell.Management\Get-ChildItem`).
114110

115111

116112
> [!TIP]
117-
> Use script files instead of inline scripts for better tooling support and linting capabilities. The PowerShell extension for Visual Studio Code and
118-
> PowerShell linters like PSScriptAnalyzer will work natively with script files.
119-
>
113+
> Use script files instead of inline scripts for better tooling support and linting. The PowerShell extension for Visual Studio Code and
114+
> linters like PSScriptAnalyzer work natively with script files.
120115

121116
#### Example 2: Run a GitHub PowerShell script without a token
122117

123-
Run a script that uses the GitHub PowerShell module.
124-
This example runs a non-authenticated script that gets the GitHub Zen message.
118+
Runs a non-authenticated script that retrieves the GitHub Zen message.
125119

126120
```yaml
127121
jobs:
@@ -140,8 +134,8 @@ jobs:
140134

141135
#### Example 3: Run a GitHub PowerShell script with a custom token
142136

143-
Run a script that uses the GitHub PowerShell module with a token. The token can be both a personal access token (PAT) or
144-
an installation access token (IAT). This example runs an authenticated script that gets the GitHub Zen message.
137+
Runs a script that uses the GitHub PowerShell module with a token. The token can be a personal access token (PAT) or
138+
an installation access token (IAT). This example retrieves the GitHub Zen message.
145139

146140
```yaml
147141
jobs:
@@ -160,8 +154,7 @@ jobs:
160154

161155
#### Example 4: Run a GitHub PowerShell script with a GitHub App using a Client ID and Private Key
162156

163-
Run a script that uses the GitHub PowerShell module with a GitHub App.
164-
This example runs an authenticated script that gets the GitHub App.
157+
Runs a script that uses the GitHub PowerShell module with a GitHub App. This example retrieves the GitHub App details.
165158

166159
```yaml
167160
jobs:
@@ -179,9 +172,9 @@ jobs:
179172
}
180173
```
181174

182-
#### Example 5: Using the outputs from the script
175+
#### Example 5: Using outputs from the script
183176

184-
Run a script that uses the GitHub PowerShell module and outputs the result.
177+
Runs a script that uses the GitHub PowerShell module and outputs the result.
185178

186179
```yaml
187180
- name: Run GitHub Script
@@ -199,13 +192,13 @@ Run a script that uses the GitHub PowerShell module and outputs the result.
199192
env:
200193
result: ${{ steps.test.outputs.result }}
201194
run: |
202-
$result = $env:result | ConvertFrom-Json
203-
Set-GitHubStepSummary -Summary $result.WISECAT
204-
Write-GitHubNotice -Message $result.Zen -Title 'GitHub Zen'
195+
$result = $env:result | ConvertFrom-Json
196+
Set-GitHubStepSummary -Summary $result.WISECAT
197+
Write-GitHubNotice -Message $result.Zen -Title 'GitHub Zen'
205198
```
206199

207-
## Related projects
200+
## Related Projects
208201

209-
- [actions/create-github-app-token](https://github.com/actions/create-github-app-token) -> Functionality will be brought into GitHub PowerShell module.
202+
- [actions/create-github-app-token](https://github.com/actions/create-github-app-token) Functionality will be incorporated into the GitHub PowerShell module.
210203
- [actions/github-script](https://github.com/actions/github-script)
211204
- [PSModule/GitHub](https://github.com/PSModule/GitHub)

0 commit comments

Comments
 (0)