You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🚀[Feature]: Control if GitHub credentials are persisted (#50)
You now have the option to decide if your GitHub credentials should be
kept or automatically disconnected after the script finishes. This gives
you more flexibility and helps improve security when needed.
### How It Works
* **By default**, your GitHub credentials will be preserved, just like
before—no changes needed on your part.
* **If you want your credentials to be automatically disconnected after
the script runs**, set the new `PreserveCredentials` option to `false`.
### Example
Here’s how to disconnect your credentials after running a script:
```yaml
- name: Run script with credential cleanup
uses: PSModule/GitHub-Script@v1
with:
PreserveCredentials: false
Script: |
Get-GitHubUser
# Your credentials will be disconnected after this step
```
That’s it! Use this new option if you want to make sure your GitHub
connection is cleaned up automatically after your workflow.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
Co-authored-by: Marius Storhaug <marstor@hotmail.com>
Copy file name to clipboardExpand all lines: README.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,7 @@ To get started with your own GitHub PowerShell based action, [create a new repos
24
24
|`ShowInit`| Show information about the initialization. | false |`'false'`|
25
25
|`ShowOutput`| Show the script's output. | false |`'false'`|
26
26
|`WorkingDirectory`| The working directory where the script runs. | false |`'.'`|
27
+
|`PreserveCredentials`| Preserve credentials after script execution. If false, disconnects GitHub contexts and CLI using Disconnect-GitHubAccount. | false |`'true'`|
27
28
28
29
### Outputs
29
30
@@ -199,3 +200,17 @@ Runs a script that uses the GitHub PowerShell module and outputs the result.
0 commit comments