Skip to content

Commit 030d02d

Browse files
🩹 [Patch]: Refactor Action-Test workflow to simplify steps and enhance debugging options
1 parent 19246a1 commit 030d02d

File tree

1 file changed

+129
-125
lines changed

1 file changed

+129
-125
lines changed

‎.github/workflows/Action-Test.yml‎

Lines changed: 129 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -20,113 +20,6 @@ jobs:
2020
ActionTestBasic:
2121
name: Action-Test - [Basic]
2222
runs-on: ubuntu-latest
23-
steps:
24-
# Need to check out as part of the test, as its a local action
25-
- name: Checkout repo
26-
uses: actions/checkout@v4
27-
28-
- name: Action-Test
29-
uses: ./
30-
31-
ActionTestWithScript:
32-
name: Action-Test - [WithScript]
33-
runs-on: ubuntu-latest
34-
steps:
35-
# Need to check out as part of the test, as its a local action
36-
- name: Checkout repo
37-
uses: actions/checkout@v4
38-
39-
- name: Action-Test
40-
uses: ./
41-
with:
42-
Script: |
43-
LogGroup 'Get-GitHubZen' {
44-
Get-GitHubZen
45-
}
46-
47-
ActionTestCommands:
48-
name: Action-Test - [Commands]
49-
runs-on: ubuntu-latest
50-
steps:
51-
# Need to check out as part of the test, as its a local action
52-
- name: Checkout repo
53-
uses: actions/checkout@v4
54-
55-
- name: Action-Test
56-
uses: ./
57-
id: test
58-
with:
59-
Prerelease: true
60-
Script: |
61-
$cat = Get-GitHubOctocat
62-
$zen = Get-GitHubZen
63-
Set-GitHubEnvironmentVariable -Name 'OCTOCAT' -Value $cat
64-
Set-GitHubOutput -Name 'WISECAT' -Value $cat
65-
Set-GitHubOutput -Name 'Zen' -Value $zen
66-
67-
- name: Run-test
68-
shell: pwsh
69-
env:
70-
result: ${{ steps.test.outputs.result }}
71-
run: |
72-
$result = $env:result | ConvertFrom-Json
73-
Set-GitHubStepSummary -Summary $result.WISECAT
74-
Write-GitHubNotice -Message $result.Zen -Title 'GitHub Zen'
75-
76-
ActionTestWithoutToken:
77-
name: Action-Test - [WithoutToken]
78-
runs-on: ubuntu-latest
79-
steps:
80-
# Need to check out as part of the test, as its a local action
81-
- name: Checkout repo
82-
uses: actions/checkout@v4
83-
84-
- name: Action-Test
85-
uses: ./
86-
with:
87-
Token: ''
88-
Script: |
89-
LogGroup 'My group' {
90-
'This is a group'
91-
}
92-
93-
ActionTestWithPAT:
94-
name: Action-Test - [WithPAT]
95-
runs-on: ubuntu-latest
96-
steps:
97-
# Need to check out as part of the test, as its a local action
98-
- name: Checkout repo
99-
uses: actions/checkout@v4
100-
101-
- name: Action-Test
102-
uses: ./
103-
with:
104-
Token: ${{ secrets.TEST_PAT }}
105-
Script: |
106-
LogGroup 'Get-GitHubUser' {
107-
Get-GitHubUser | Format-Table -AutoSize
108-
}
109-
110-
ActionTestWithFGPAT:
111-
name: Action-Test - [WithFGPAT]
112-
runs-on: ubuntu-latest
113-
steps:
114-
# Need to check out as part of the test, as its a local action
115-
- name: Checkout repo
116-
uses: actions/checkout@v4
117-
118-
- name: Action-Test
119-
uses: ./
120-
with:
121-
Token: ${{ secrets.TEST_FG_PAT }}
122-
Script: |
123-
LogGroup 'Get-GitHubUser' {
124-
Get-GitHubUser | Format-Table -AutoSize
125-
}
126-
127-
ActionTestWithGitHubApp:
128-
name: Action-Test - [GitHubApp]
129-
runs-on: ubuntu-latest
13023
steps:
13124
# Need to check out as part of the test, as its a local action
13225
- name: Checkout repo
@@ -135,21 +28,132 @@ jobs:
13528
- name: Action-Test
13629
uses: ./
13730
with:
138-
ClientID: ${{ secrets.TEST_APP_CLIENT_ID }}
139-
PrivateKey: ${{ secrets.TEST_APP_PRIVATE_KEY }}
140-
Script: |
141-
LogGroup 'Get-GitHubApp' {
142-
Get-GitHubApp | Format-Table -AutoSize
143-
}
144-
145-
LogGroup 'Get-GitHubAppInstallation' {
146-
Get-GitHubAppInstallation | Format-Table -AutoSize
147-
}
148-
149-
LogGroup 'Do something as an installation' {
150-
Get-GithubAppInstallation | New-GitHubAppInstallationAccessToken | ForEach-Object {
151-
Connect-GitHub -Token $_.token -Silent
152-
Get-GitHubContext | Format-Table -AutoSize
153-
Get-GitHubGitConfig | Format-Table -AutoSize
154-
}
155-
}
31+
Debug: true
32+
Verbose: true
33+
34+
35+
# ActionTestWithScript:
36+
# name: Action-Test - [WithScript]
37+
# runs-on: ubuntu-latest
38+
# steps:
39+
# # Need to check out as part of the test, as its a local action
40+
# - name: Checkout repo
41+
# uses: actions/checkout@v4
42+
43+
# - name: Action-Test
44+
# uses: ./
45+
# with:
46+
# Script: |
47+
# LogGroup 'Get-GitHubZen' {
48+
# Get-GitHubZen
49+
# }
50+
51+
# ActionTestCommands:
52+
# name: Action-Test - [Commands]
53+
# runs-on: ubuntu-latest
54+
# steps:
55+
# # Need to check out as part of the test, as its a local action
56+
# - name: Checkout repo
57+
# uses: actions/checkout@v4
58+
59+
# - name: Action-Test
60+
# uses: ./
61+
# id: test
62+
# with:
63+
# Prerelease: true
64+
# Script: |
65+
# $cat = Get-GitHubOctocat
66+
# $zen = Get-GitHubZen
67+
# Set-GitHubEnvironmentVariable -Name 'OCTOCAT' -Value $cat
68+
# Set-GitHubOutput -Name 'WISECAT' -Value $cat
69+
# Set-GitHubOutput -Name 'Zen' -Value $zen
70+
71+
# - name: Run-test
72+
# shell: pwsh
73+
# env:
74+
# result: ${{ steps.test.outputs.result }}
75+
# run: |
76+
# $result = $env:result | ConvertFrom-Json
77+
# Set-GitHubStepSummary -Summary $result.WISECAT
78+
# Write-GitHubNotice -Message $result.Zen -Title 'GitHub Zen'
79+
80+
# ActionTestWithoutToken:
81+
# name: Action-Test - [WithoutToken]
82+
# runs-on: ubuntu-latest
83+
# steps:
84+
# # Need to check out as part of the test, as its a local action
85+
# - name: Checkout repo
86+
# uses: actions/checkout@v4
87+
88+
# - name: Action-Test
89+
# uses: ./
90+
# with:
91+
# Token: ''
92+
# Script: |
93+
# LogGroup 'My group' {
94+
# 'This is a group'
95+
# }
96+
97+
# ActionTestWithPAT:
98+
# name: Action-Test - [WithPAT]
99+
# runs-on: ubuntu-latest
100+
# steps:
101+
# # Need to check out as part of the test, as its a local action
102+
# - name: Checkout repo
103+
# uses: actions/checkout@v4
104+
105+
# - name: Action-Test
106+
# uses: ./
107+
# with:
108+
# Token: ${{ secrets.TEST_PAT }}
109+
# Script: |
110+
# LogGroup 'Get-GitHubUser' {
111+
# Get-GitHubUser | Format-Table -AutoSize
112+
# }
113+
114+
# ActionTestWithFGPAT:
115+
# name: Action-Test - [WithFGPAT]
116+
# runs-on: ubuntu-latest
117+
# steps:
118+
# # Need to check out as part of the test, as its a local action
119+
# - name: Checkout repo
120+
# uses: actions/checkout@v4
121+
122+
# - name: Action-Test
123+
# uses: ./
124+
# with:
125+
# Token: ${{ secrets.TEST_FG_PAT }}
126+
# Script: |
127+
# LogGroup 'Get-GitHubUser' {
128+
# Get-GitHubUser | Format-Table -AutoSize
129+
# }
130+
131+
# ActionTestWithGitHubApp:
132+
# name: Action-Test - [GitHubApp]
133+
# runs-on: ubuntu-latest
134+
# steps:
135+
# # Need to check out as part of the test, as its a local action
136+
# - name: Checkout repo
137+
# uses: actions/checkout@v4
138+
139+
# - name: Action-Test
140+
# uses: ./
141+
# with:
142+
# ClientID: ${{ secrets.TEST_APP_CLIENT_ID }}
143+
# PrivateKey: ${{ secrets.TEST_APP_PRIVATE_KEY }}
144+
# Script: |
145+
# LogGroup 'Get-GitHubApp' {
146+
# Get-GitHubApp | Format-Table -AutoSize
147+
# }
148+
149+
# LogGroup 'Get-GitHubAppInstallation' {
150+
# Get-GitHubAppInstallation | Format-Table -AutoSize
151+
# }
152+
153+
# LogGroup 'Do something as an installation' {
154+
# Get-GithubAppInstallation | New-GitHubAppInstallationAccessToken | ForEach-Object {
155+
# Connect-GitHub -Token $_.token -Silent
156+
# Get-GitHubContext | Format-Table -AutoSize
157+
# Get-GitHubGitConfig | Format-Table -AutoSize
158+
# }
159+
# }

0 commit comments

Comments
 (0)