Skip to content

Commit 968f8f0

Browse files
Add PreserveCredentials example to README
Co-authored-by: MariusStorhaug <[email protected]>
1 parent 9f8c8a2 commit 968f8f0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,3 +200,17 @@ Runs a script that uses the GitHub PowerShell module and outputs the result.
200200
Set-GitHubStepSummary -Summary $result.WISECAT
201201
Write-GitHubNotice -Message $result.Zen -Title 'GitHub Zen'
202202
```
203+
204+
#### Example 6: Run a script with credential cleanup
205+
206+
Runs a script with `PreserveCredentials` set to `false` to automatically disconnect GitHub credentials after execution.
207+
208+
```yaml
209+
- name: Run script with credential cleanup
210+
uses: PSModule/GitHub-Script@v1
211+
with:
212+
PreserveCredentials: false
213+
Script: |
214+
Get-GitHubUser
215+
# Credentials will be disconnected after this step
216+
```

0 commit comments

Comments
 (0)