Skip to content

Commit c4b92c6

Browse files
🩹 [Patch]: Add separate Prerelease test workflow (#32)
## Description This pull request introduces a new workflow for testing prerelease versions of actions and updates the existing test workflow to support this new feature. ### New Workflow: * [`.github/workflows/Action-Test-Prerelease.yml`](diffhunk://#diff-b5194b0e3305a1cd2a92e3524b1d419f9f3b4ee3d039158dcf12a513a3455953R1-R29): Added a new workflow named `Action-Test-Prerelease` that runs on `workflow_dispatch`. It uses the existing `TestWorkflow.yml` with the `Prerelease` input set to true. This workflow is used for testing prereleases of the `GitHub` PowerShell module. ### Updates to Existing Workflow * [`.github/workflows/TestWorkflow.yml`](diffhunk://#diff-242a265d6d6bfff6094c9285345022d0e6d7ddde58504dfc80249fafbd89ba2cL5-R33): Added a `Prerelease` input to the `workflow_call` section to allow running the prerelease version of the action. * [`.github/workflows/TestWorkflow.yml`](diffhunk://#diff-242a265d6d6bfff6094c9285345022d0e6d7ddde58504dfc80249fafbd89ba2cR52-R59): Updated multiple jobs to include the `Prerelease` input, ensuring that the prerelease version is used during tests. This includes various test jobs and scripts. [[1]](diffhunk://#diff-242a265d6d6bfff6094c9285345022d0e6d7ddde58504dfc80249fafbd89ba2cR52-R59) [[2]](diffhunk://#diff-242a265d6d6bfff6094c9285345022d0e6d7ddde58504dfc80249fafbd89ba2cR86-R128) [[3]](diffhunk://#diff-242a265d6d6bfff6094c9285345022d0e6d7ddde58504dfc80249fafbd89ba2cL130-R144) [[4]](diffhunk://#diff-242a265d6d6bfff6094c9285345022d0e6d7ddde58504dfc80249fafbd89ba2cR199) [[5]](diffhunk://#diff-242a265d6d6bfff6094c9285345022d0e6d7ddde58504dfc80249fafbd89ba2cR217) [[6]](diffhunk://#diff-242a265d6d6bfff6094c9285345022d0e6d7ddde58504dfc80249fafbd89ba2cR235) [[7]](diffhunk://#diff-242a265d6d6bfff6094c9285345022d0e6d7ddde58504dfc80249fafbd89ba2cR253) [[8]](diffhunk://#diff-242a265d6d6bfff6094c9285345022d0e6d7ddde58504dfc80249fafbd89ba2cR272) [[9]](diffhunk://#diff-242a265d6d6bfff6094c9285345022d0e6d7ddde58504dfc80249fafbd89ba2cR303) ## 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 cdcb935 commit c4b92c6

File tree

2 files changed

+55
-9
lines changed

2 files changed

+55
-9
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Action-Test-Prerelease
2+
3+
run-name: "Action-Test - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
4+
5+
on:
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: read
14+
pull-requests: read
15+
16+
jobs:
17+
ActionTest:
18+
uses: ./.github/workflows/TestWorkflow.yml
19+
secrets: inherit
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
os: [ubuntu-latest, macos-latest, windows-latest]
24+
with:
25+
runs-on: ${{ matrix.os }}
26+
Prerelease: true

.github/workflows/TestWorkflow.yml

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,35 @@ on:
22
workflow_call:
33
inputs:
44
runs-on:
5-
description: 'The operating system to run the tests on'
5+
description: The operating system to run the tests on
66
required: true
77
type: string
8+
Prerelease:
9+
description: Run the prerelease version of the action
10+
required: false
11+
type: boolean
12+
default: false
813
secrets:
914
TEST_USER_PAT:
10-
description: 'Personal Access Token for the test user'
15+
description: Personal Access Token for the test user
1116
required: true
1217
TEST_USER_USER_FG_PAT:
13-
description: 'Personal Access Token for the test user with full gists scope'
18+
description: Personal Access Token for the test user with full gists scope
1419
required: true
1520
TEST_USER_ORG_FG_PAT:
16-
description: 'Personal Access Token for the test user with full gists scope'
21+
description: Personal Access Token for the test user with full gists scope
1722
required: true
1823
TEST_APP_ENT_CLIENT_ID:
19-
description: 'Client ID for the test GitHub App for the enterprise'
24+
description: Client ID for the test GitHub App for the enterprise
2025
required: true
2126
TEST_APP_ENT_PRIVATE_KEY:
22-
description: 'Private Key for the test GitHub App for the enterprise'
27+
description: Private Key for the test GitHub App for the enterprise
2328
required: true
2429
TEST_APP_ORG_CLIENT_ID:
25-
description: 'Client ID for the test GitHub App for the organization'
30+
description: Client ID for the test GitHub App for the organization
2631
required: true
2732
TEST_APP_ORG_PRIVATE_KEY:
28-
description: 'Private Key for the test GitHub App for the organization'
33+
description: Private Key for the test GitHub App for the organization
2934
required: true
3035

3136
permissions:
@@ -44,12 +49,14 @@ jobs:
4449
- name: Action-Test
4550
uses: ./
4651
with:
52+
Prerelease: ${{ inputs.Prerelease }}
4753
Debug: true
4854
Verbose: true
4955

5056
- name: Action-Test [ShowInit]
5157
uses: ./
5258
with:
59+
Prerelease: ${{ inputs.Prerelease }}
5360
Debug: true
5461
Verbose: true
5562
ShowInit: true
@@ -76,42 +83,49 @@ jobs:
7683
uses: ./
7784
with:
7885
Script: tests/info.ps1
86+
Prerelease: ${{ inputs.Prerelease }}
7987

8088
- name: Action-Test [.\tests\info.ps1]
8189
if: success() || failure()
8290
uses: ./
8391
with:
8492
Script: .\tests\info.ps1
93+
Prerelease: ${{ inputs.Prerelease }}
8594

8695
- name: Action-Test [./tests/info.ps1]
8796
if: success() || failure()
8897
uses: ./
8998
with:
9099
Script: ./tests/info.ps1
100+
Prerelease: ${{ inputs.Prerelease }}
91101

92102
- name: Action-Test [. .\tests\info.ps1]
93103
if: success() || failure()
94104
uses: ./
95105
with:
96106
Script: . .\tests\info.ps1
107+
Prerelease: ${{ inputs.Prerelease }}
97108

98109
- name: Action-Test [. ./tests/info.ps1]
99110
if: success() || failure()
100111
uses: ./
101112
with:
102113
Script: . ./tests/info.ps1
114+
Prerelease: ${{ inputs.Prerelease }}
103115

104116
- name: Action-Test [. '.\tests\info.ps1']
105117
if: success() || failure()
106118
uses: ./
107119
with:
108120
Script: . '.\tests\info.ps1'
121+
Prerelease: ${{ inputs.Prerelease }}
109122

110123
- name: Action-Test [. './tests/info.ps1']
111124
if: success() || failure()
112125
uses: ./
113126
with:
114127
Script: . './tests/info.ps1'
128+
Prerelease: ${{ inputs.Prerelease }}
115129

116130
ActionTestCommands:
117131
name: Commands + Outputs
@@ -127,7 +141,7 @@ jobs:
127141
with:
128142
Debug: true
129143
Verbose: true
130-
Prerelease: true
144+
Prerelease: ${{ inputs.Prerelease }}
131145
ShowInit: true
132146
ShowOutput: true
133147
Script: |
@@ -182,6 +196,7 @@ jobs:
182196
uses: ./
183197
with:
184198
Token: ''
199+
Prerelease: ${{ inputs.Prerelease }}
185200
Script: |
186201
LogGroup 'My group' {
187202
'This is a group'
@@ -199,6 +214,7 @@ jobs:
199214
uses: ./
200215
with:
201216
Token: ${{ secrets.TEST_USER_PAT }}
217+
Prerelease: ${{ inputs.Prerelease }}
202218
Script: |
203219
LogGroup 'Get-GitHubUser' {
204220
Get-GitHubUser | Format-Table -AutoSize
@@ -216,6 +232,7 @@ jobs:
216232
uses: ./
217233
with:
218234
Token: ${{ secrets.TEST_USER_USER_FG_PAT }}
235+
Prerelease: ${{ inputs.Prerelease }}
219236
Script: |
220237
LogGroup 'Get-GitHubUser' {
221238
Get-GitHubUser | Format-Table -AutoSize
@@ -233,6 +250,7 @@ jobs:
233250
uses: ./
234251
with:
235252
Token: ${{ secrets.TEST_USER_ORG_FG_PAT }}
253+
Prerelease: ${{ inputs.Prerelease }}
236254
Script: |
237255
LogGroup 'Get-GitHubUser' {
238256
Get-GitHubUser | Format-Table -AutoSize
@@ -251,6 +269,7 @@ jobs:
251269
with:
252270
ClientID: ${{ secrets.TEST_APP_ENT_CLIENT_ID }}
253271
PrivateKey: ${{ secrets.TEST_APP_ENT_PRIVATE_KEY }}
272+
Prerelease: ${{ inputs.Prerelease }}
254273
Script: |
255274
LogGroup 'Get-GitHubApp' {
256275
Get-GitHubApp | Format-Table -AutoSize
@@ -281,6 +300,7 @@ jobs:
281300
with:
282301
ClientID: ${{ secrets.TEST_APP_ORG_CLIENT_ID }}
283302
PrivateKey: ${{ secrets.TEST_APP_ORG_PRIVATE_KEY }}
303+
Prerelease: ${{ inputs.Prerelease }}
284304
Script: |
285305
LogGroup 'Get-GitHubApp' {
286306
Get-GitHubApp | Format-Table -AutoSize

0 commit comments

Comments
 (0)