Skip to content

Commit e898fbe

Browse files
Document ShowRateLimit input and add usage example
1 parent 91b9923 commit e898fbe

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ To get started with your own GitHub PowerShell based action, [create a new repos
2424
| `ShowInfo` | Show information about the environment. | false | `'true'` |
2525
| `ShowInit` | Show information about the initialization. | false | `'false'` |
2626
| `ShowOutput` | Show the script's output. | false | `'false'` |
27+
| `ShowRateLimit` | Show GitHub API rate limit information before and after script execution. | false | `'false'` |
2728
| `WorkingDirectory` | The working directory where the script runs. | false | `'.'` |
2829
| `PreserveCredentials` | Preserve credentials after script execution. If false, disconnects GitHub contexts and CLI using Disconnect-GitHubAccount. | false | `'true'` |
2930

@@ -243,3 +244,16 @@ Runs a script with `PreserveCredentials` set to `false` to automatically disconn
243244
Get-GitHubUser
244245
# Credentials will be disconnected after this step
245246
```
247+
248+
#### Example 8: Show GitHub API rate limit usage
249+
250+
Displays the GitHub API rate limit status before and after the script runs. The **Rate Limits** log group shows `Limit`, `Used`, `Remaining`, `ResetsAt`, and `ResetsIn` for every resource category (core, search, graphql, etc.), making it easy to see exactly how many API calls a workflow step consumed.
251+
252+
```yaml
253+
- name: Run script with rate limit visibility
254+
uses: PSModule/GitHub-Script@v1
255+
with:
256+
ShowRateLimit: 'true'
257+
Script: |
258+
Get-GitHubRepository -Owner PSModule -Name GitHub-Script
259+
```

0 commit comments

Comments
 (0)