Skip to content

Commit b2cd139

Browse files
🩹 [Patch]: Add tests for more use-cases (#16)
## Description This pull request includes several updates to the `Action-Test` workflow configuration in the `.github/workflows/Action-Test.yml` file. The main changes involve updating the token and credentials handling to use matrix strategies for better flexibility and security. Improvements to token handling: * Updated the token reference from `TEST_PAT` to `TEST_USER_PAT` in the `Action-Test` job. * Changed the token reference for `ActionTestWithFGPAT` to use a matrix strategy, allowing for different tokens based on the matrix configuration. Enhancements to GitHub App credentials: * Updated the GitHub App credentials handling in the `ActionTestWithGitHubApp` job to use a matrix strategy, allowing for different client IDs and private keys based on the matrix configuration. [[1]](diffhunk://#diff-a12ae5c885b0673c0ff6f70c2670886907590d624626e07da4c52e01aeaf56a4L132-R155) [[2]](diffhunk://#diff-a12ae5c885b0673c0ff6f70c2670886907590d624626e07da4c52e01aeaf56a4L149-R166) ## 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 00b83a8 commit b2cd139

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

.github/workflows/Action-Test.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,21 @@ jobs:
112112
- name: Action-Test
113113
uses: ./
114114
with:
115-
Token: ${{ secrets.TEST_PAT }}
115+
Token: ${{ secrets.TEST_USER_PAT }}
116116
Script: |
117117
LogGroup 'Get-GitHubUser' {
118118
Get-GitHubUser | Format-Table -AutoSize
119119
}
120120
121121
ActionTestWithFGPAT:
122-
name: Action-Test - [WithFGPAT]
122+
strategy:
123+
matrix:
124+
include:
125+
- name: Action-Test - [WithUserFGPAT]
126+
Token: TEST_USER_USER_FG_PAT
127+
- name: Action-Test - [WithOrgFGPAT]
128+
Token: TEST_USER_ORG_FG_PAT
129+
name: ${{ matrix.name }}
123130
runs-on: ubuntu-latest
124131
steps:
125132
# Need to check out as part of the test, as its a local action
@@ -129,14 +136,23 @@ jobs:
129136
- name: Action-Test
130137
uses: ./
131138
with:
132-
Token: ${{ secrets.TEST_FG_PAT }}
139+
Token: ${{ secrets[matrix.Token] }}
133140
Script: |
134141
LogGroup 'Get-GitHubUser' {
135142
Get-GitHubUser | Format-Table -AutoSize
136143
}
137144
138145
ActionTestWithGitHubApp:
139-
name: Action-Test - [GitHubApp]
146+
strategy:
147+
matrix:
148+
include:
149+
- name: Action-Test - [GitHubAppEnt]
150+
clientID: TEST_APP_ENT_CLIENT_ID
151+
privateKey: TEST_APP_ENT_PRIVATE_KEY
152+
- name: Action-Test - [GitHubAppOrg]
153+
clientID: TEST_APP_ORG_CLIENT_ID
154+
privateKey: TEST_APP_ORG_PRIVATE_KEY
155+
name: ${{ matrix.name }}
140156
runs-on: ubuntu-latest
141157
steps:
142158
# Need to check out as part of the test, as its a local action
@@ -146,8 +162,8 @@ jobs:
146162
- name: Action-Test
147163
uses: ./
148164
with:
149-
ClientID: ${{ secrets.TEST_APP_CLIENT_ID }}
150-
PrivateKey: ${{ secrets.TEST_APP_PRIVATE_KEY }}
165+
ClientID: ${{ secrets[matrix.clientID] }}
166+
PrivateKey: ${{ secrets[matrix.privateKey] }}
151167
Script: |
152168
LogGroup 'Get-GitHubApp' {
153169
Get-GitHubApp | Format-Table -AutoSize

0 commit comments

Comments
 (0)