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
## Description
- Runs a PowerShell script with the GitHub PowerShell module.
## Type of change
<!-- Use the check-boxes [x] on the options that are relevant. -->
- [ ] 📖 [Docs]
- [ ] 🪲 [Fix]
- [ ] 🩹 [Patch]
- [ ] ⚠️ [Security fix]
- [ ] 🚀 [Feature]
- [x] 🌟 [Breaking change]
## Checklist
<!-- Use the check-boxes [x] on the options that are relevant. -->
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
|`Version`|The version of the GitHub module to install| false | 'latest' |
15
+
|`Version`|Specifies the version of the resource to be returned. The value can be an exact version or a version range using the NuGet versioning syntax.| false | 'latest' |
16
16
|`Prerelease`| Allow prerelease versions if available | false | 'false' |
17
17
|`WorkingDirectory`| The working directory where the script will run from | false | ${{ github.workspace }} |
18
18
19
-
<!--
20
-
Token
21
-
JWT
22
-
AppID
23
-
Repos
24
-
Organization
25
-
Host -> github.com, *.ghe.com
26
-
-->
19
+
### Examples
27
20
28
-
<!--### Secrets -->
21
+
#### Example 1: Run a script that uses the GitHub PowerShell module
29
22
30
-
<!--
31
-
Token
32
-
JWT
33
-
-->
23
+
Run a script that uses the GitHub PowerShell module.
24
+
This example runs a non-authenticated script that gets the GitHub Zen message.
34
25
35
-
<!-- ### Outputs -->
26
+
```yaml
27
+
jobs:
28
+
Run-Script:
29
+
runs-on: ubuntu-latest
30
+
steps:
31
+
- name: Run script
32
+
uses: PSModule/GitHub-Script@v1
33
+
with:
34
+
Script: |
35
+
LogGroup "Get-GitHubZen" {
36
+
Get-GitHubZen
37
+
}
38
+
```
39
+
40
+
#### Example 2: Run a script that uses the GitHub PowerShell module with a token
36
41
37
-
### Example
42
+
Run a script that uses the GitHub PowerShell module with a token.
43
+
This example runs an authenticated script that gets the GitHub Zen message.
38
44
39
45
```yaml
40
-
Example here
46
+
jobs:
47
+
Run-Script:
48
+
runs-on: ubuntu-latest
49
+
steps:
50
+
- name: Run script
51
+
uses: PSModule/GitHub-Script@v1
52
+
with:
53
+
Token: ${{ github.token }}
54
+
Script: |
55
+
LogGroup "Get-GitHubZen" {
56
+
Get-GitHubZen
57
+
}
41
58
```
42
59
43
-
### Similar projects
60
+
## Related projects
44
61
45
62
- [actions/create-github-app-token](https://github.com/actions/create-github-app-token) -> Functionality will be brought into GitHub PowerShell module.
0 commit comments