Skip to content

Commit 364486d

Browse files
🩹 [Patch]: Initial version (#1)
## Description - Install the GitHub PowerShell module. - Run a script using the default context (runner github token). ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [x] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [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
1 parent 5db2ae2 commit 364486d

File tree

9 files changed

+210
-196
lines changed

9 files changed

+210
-196
lines changed

.github/workflows/Action-Test.yml

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,39 @@
1-
name: Action-Test
2-
3-
run-name: "Action-Test - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
4-
5-
on: [pull_request]
6-
7-
concurrency:
8-
group: ${{ github.workflow }}-${{ github.ref }}
9-
cancel-in-progress: true
10-
11-
permissions:
12-
contents: read
13-
pull-requests: read
14-
15-
jobs:
16-
ActionTestBasic:
17-
name: Action-Test - [Basic]
18-
runs-on: ubuntu-latest
19-
steps:
20-
# Need to check out as part of the test, as its a local action
21-
- name: Checkout repo
22-
uses: actions/checkout@v4
23-
24-
- name: Action-Test
25-
uses: ./
26-
with:
27-
working-directory: ./tests
28-
subject: PSModule
1+
name: Action-Test
2+
3+
run-name: "Action-Test - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
4+
5+
on: [pull_request]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
permissions:
12+
contents: read
13+
pull-requests: read
14+
15+
jobs:
16+
ActionTestBasic:
17+
name: Action-Test - [Basic]
18+
runs-on: ubuntu-latest
19+
steps:
20+
# Need to check out as part of the test, as its a local action
21+
- name: Checkout repo
22+
uses: actions/checkout@v4
23+
24+
- name: Action-Test
25+
uses: ./
26+
with:
27+
script: |
28+
LogGroup "Test-PSModule" {
29+
Get-GitHubZen
30+
}
31+
32+
- name: Action-Test 2
33+
uses: ./
34+
with:
35+
Verbose: true
36+
script: |
37+
LogGroup "Test-PSModule" {
38+
Get-GitHubZen
39+
}

.github/workflows/Auto-Configure.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/Auto-Document.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/Auto-Release.yml

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
name: Auto-Release
2-
3-
run-name: "Auto-Release - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
4-
5-
on:
6-
pull_request_target:
7-
branches:
8-
- main
9-
types:
10-
- closed
11-
- opened
12-
- reopened
13-
- synchronize
14-
- labeled
15-
16-
concurrency:
17-
group: ${{ github.workflow }}-${{ github.ref }}
18-
cancel-in-progress: true
19-
20-
permissions:
21-
contents: write # Required to create releases
22-
pull-requests: write # Required to create comments on the PRs
23-
24-
jobs:
25-
Auto-Release:
26-
runs-on: ubuntu-latest
27-
steps:
28-
- name: Checkout Code
29-
uses: actions/checkout@v4
30-
31-
- name: Auto-Release
32-
uses: PSModule/Auto-Release@v1
33-
env:
34-
GITHUB_TOKEN: ${{ github.token }}
1+
name: Auto-Release
2+
3+
run-name: "Auto-Release - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
4+
5+
on:
6+
pull_request_target:
7+
branches:
8+
- main
9+
types:
10+
- closed
11+
- opened
12+
- reopened
13+
- synchronize
14+
- labeled
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
permissions:
21+
contents: write # Required to create releases
22+
pull-requests: write # Required to create comments on the PRs
23+
24+
jobs:
25+
Auto-Release:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout Code
29+
uses: actions/checkout@v4
30+
31+
- name: Auto-Release
32+
uses: PSModule/Auto-Release@v1
33+
env:
34+
GITHUB_TOKEN: ${{ github.token }}

.github/workflows/Linter.yml

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
1-
name: Linter
2-
3-
run-name: "Linter - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
4-
5-
on: [pull_request]
6-
7-
concurrency:
8-
group: ${{ github.workflow }}-${{ github.ref }}
9-
cancel-in-progress: true
10-
11-
permissions:
12-
contents: read
13-
packages: read
14-
statuses: write
15-
16-
jobs:
17-
Lint:
18-
name: Lint code base
19-
runs-on: ubuntu-latest
20-
steps:
21-
- name: Checkout repo
22-
uses: actions/checkout@v4
23-
with:
24-
fetch-depth: 0
25-
26-
- name: Lint code base
27-
uses: super-linter/super-linter/slim@latest
28-
env:
29-
GITHUB_TOKEN: ${{ github.token }}
1+
name: Linter
2+
3+
run-name: "Linter - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
4+
5+
on: [pull_request]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
permissions:
12+
contents: read
13+
packages: read
14+
statuses: write
15+
16+
jobs:
17+
Lint:
18+
name: Lint code base
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout repo
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Lint code base
27+
uses: super-linter/super-linter/slim@latest
28+
env:
29+
GITHUB_TOKEN: ${{ github.token }}
30+
VALIDATE_MARKDOWN_PRETTIER: false
31+
VALIDATE_YAML_PRETTIER: false

README.md

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,47 @@
1-
# Template-action
1+
# GitHub-Script
22

3-
A template repository for GitHub Actions
3+
A GitHub Action used for running a PowerShell Script that uses the GitHub PowerShell module
44

55
## Usage
66

77
### Inputs
88

9-
### Secrets
9+
| Name | Description | Required | Default |
10+
| - | - | - | - |
11+
| `Script` | The script to run | true | |
12+
| `Token` | The GitHub token to use | false | ${{ github.token }} |
13+
| `Debug` | Enable debug output | false | 'false' |
14+
| `Verbose` | Enable verbose output | false | 'false' |
15+
| `Version` | The version of the GitHub module to install | false | 'latest' |
16+
| `Prerelease` | Allow prerelease versions if available | false | 'false' |
17+
| `WorkingDirectory` | The working directory where the script will run from | false | ${{ github.workspace }} |
1018

11-
### Outputs
19+
<!--
20+
Token
21+
JWT
22+
AppID
23+
Repos
24+
Organization
25+
Host -> github.com, *.ghe.com
26+
-->
27+
28+
<!-- ### Secrets -->
29+
30+
<!--
31+
Token
32+
JWT
33+
-->
34+
35+
<!-- ### Outputs -->
1236

1337
### Example
1438

1539
```yaml
1640
Example here
1741
```
42+
43+
### Similar projects
44+
45+
- [actions/create-github-app-token](https://github.com/actions/create-github-app-token) -> Functionality will be brought into GitHub PowerShell module.
46+
- [actions/github-script](https://github.com/actions/github-script)
47+
- [PSModule/GitHub](https://github.com/PSModule/GitHub)

0 commit comments

Comments
 (0)