Skip to content

🌟 [Major]: First release #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions .github/workflows/Action-Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,8 @@ jobs:
- name: Action-Test
uses: ./
with:
script: |
LogGroup "Test-PSModule" {
Get-GitHubZen
}

- name: Action-Test 2
uses: ./
with:
Verbose: true
script: |
LogGroup "Test-PSModule" {
Token: ${{ github.token }}
Script: |
LogGroup "Get-GitHubZen" {
Get-GitHubZen
}
55 changes: 36 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# GitHub-Script

A GitHub Action used for running a PowerShell Script that uses the GitHub PowerShell module
A GitHub Action used for running a PowerShell Script that uses the GitHub PowerShell module.

## Usage

Expand All @@ -12,35 +12,52 @@ A GitHub Action used for running a PowerShell Script that uses the GitHub PowerS
| `Token` | The GitHub token to use | false | ${{ github.token }} |
| `Debug` | Enable debug output | false | 'false' |
| `Verbose` | Enable verbose output | false | 'false' |
| `Version` | The version of the GitHub module to install | false | 'latest' |
| `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' |
| `Prerelease` | Allow prerelease versions if available | false | 'false' |
| `WorkingDirectory` | The working directory where the script will run from | false | ${{ github.workspace }} |

<!--
Token
JWT
AppID
Repos
Organization
Host -> github.com, *.ghe.com
-->
### Examples

<!-- ### Secrets -->
#### Example 1: Run a script that uses the GitHub PowerShell module

<!--
Token
JWT
-->
Run a script that uses the GitHub PowerShell module.
This example runs a non-authenticated script that gets the GitHub Zen message.

<!-- ### Outputs -->
```yaml
jobs:
Run-Script:
runs-on: ubuntu-latest
steps:
- name: Run script
uses: PSModule/GitHub-Script@v1
with:
Script: |
LogGroup "Get-GitHubZen" {
Get-GitHubZen
}
```

#### Example 2: Run a script that uses the GitHub PowerShell module with a token

### Example
Run a script that uses the GitHub PowerShell module with a token.
This example runs an authenticated script that gets the GitHub Zen message.

```yaml
Example here
jobs:
Run-Script:
runs-on: ubuntu-latest
steps:
- name: Run script
uses: PSModule/GitHub-Script@v1
with:
Token: ${{ github.token }}
Script: |
LogGroup "Get-GitHubZen" {
Get-GitHubZen
}
```

### Similar projects
## Related projects

- [actions/create-github-app-token](https://github.com/actions/create-github-app-token) -> Functionality will be brought into GitHub PowerShell module.
- [actions/github-script](https://github.com/actions/github-script)
Expand Down
3 changes: 1 addition & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ inputs:
Token:
description: The GitHub token to use.
required: false
default: ${{ github.token }}
Debug:
description: Enable debug output.
required: false
Expand Down Expand Up @@ -55,6 +54,6 @@ runs:
if ($env:GITHUB_ACTION_INPUT_Verbose -eq 'true') {
$VerbosePreference = 'Continue'
}
. "$env:GITHUB_ACTION_PATH\scripts\main.ps1"
. "${{ github.action_path }}\scripts\main.ps1"

${{ inputs.Script }}
3 changes: 0 additions & 3 deletions tests/README.md

This file was deleted.