Commit 78ff374
authored
🩹 [Patch]: Widen availability of URL for
## Description
This pull request introduces a new `HostName` parameter to the
`GitHubOrganization` class constructor and updates its usage across
various functions. The changes ensure that the `Url` property of
`GitHubOrganization` objects can dynamically include the hostname when
constructing URLs. Additionally, minor error handling improvements were
made in one function.
### Updates to `GitHubOrganization` class constructor:
*
[`src/classes/public/Owner/GitHubOwner/GitHubOrganization.ps1`](diffhunk://#diff-ee1cc4e59ef0d0762f150872a9fc2f78c80e9f3d5ce713b9e617fdbaeda48093L139-R139):
Added a `HostName` parameter to the `GitHubOrganization` constructor and
updated the `Url` property to include the hostname dynamically if
provided.
[[1]](diffhunk://#diff-ee1cc4e59ef0d0762f150872a9fc2f78c80e9f3d5ce713b9e617fdbaeda48093L139-R139)
[[2]](diffhunk://#diff-ee1cc4e59ef0d0762f150872a9fc2f78c80e9f3d5ce713b9e617fdbaeda48093L148-R148)
### Updates to functions using `GitHubOrganization`:
* [`src/functions/private/Apps/GitHub
Apps/Get-GitHubAppInstallableOrganization.ps1`](diffhunk://#diff-0a1f53a3d172fea0035dcdd32a8ca1bfa0441e91f0727c44591b3448b8c9542aL55-R55):
Updated calls to the `GitHubOrganization` constructor to pass the
`HostName` parameter from the `$Context` object.
* `src/functions/private/Organization/Get-GitHubAllOrganization.ps1`,
`src/functions/private/Organization/Get-GitHubMyOrganization.ps1`,
`src/functions/private/Organization/Get-GitHubUserOrganization.ps1`:
Updated calls to the `GitHubOrganization` constructor to pass the
`HostName` parameter from the `$Context` object.
[[1]](diffhunk://#diff-88b7f49464570f7937d5c2148aed56483c01eb5afaff12cc2ba8c0be9b723e6eL61-R61)
[[2]](diffhunk://#diff-e068816595f1abcde1a1fcfa9a80805a5302dadab28d14bd17a224e1f0264352L56-R56)
[[3]](diffhunk://#diff-c730abb0f5d97cb7dfd8dfb1aedd31839de272c3f4e714f70f6db26882504e52L58-R60)
* `src/functions/private/Organization/Get-GitHubOrganizationByName.ps1`,
`src/functions/private/Users/Get-GitHubAllUser.ps1`,
`src/functions/public/Organization/Update-GitHubOrganization.ps1`:
Updated calls to the `GitHubOrganization` constructor to pass an empty
string as the `HostName` parameter when context is unavailable.
[[1]](diffhunk://#diff-83fe1cc74ed99f4410b85163cff6dd65affd068817289729bba8aaebb88ec3b7L59-R59)
[[2]](diffhunk://#diff-a06e292f87831c3c28fe840f4e7e832f3c5f79043bee587a9e36edbcf13a4ddaL63-R63)
[[3]](diffhunk://#diff-eeb2f01e72cb4d2e7bc3bc35152d71f146c8d558aee15fa170031b8f443e17c8L207-R207)
### Error handling improvement:
*
[`src/functions/private/Users/Get-GitHubUserByName.ps1`](diffhunk://#diff-a2d6056b06ab6b0d2cb714b430a71c01e3ead9c5f890a342379b6969d422c43bR62-R72):
Added a `try-catch` block around the `Invoke-GitHubAPI` call to handle
potential errors gracefully.
## Type of change
<!-- Use the check-boxes [x] on the options that are relevant. -->
- [ ] 📖 [Docs]
- [ ] 🪲 [Fix]
- [x] 🩹 [Patch]
- [ ] GitHubOrganization (#453)1 parent 8e7b3d6 commit 78ff374
File tree
10 files changed
+23
-17
lines changed- src
- classes/public/Owner/GitHubOwner
- functions
- private
- Apps/GitHub Apps
- Organization
- Users
- public/Organization
10 files changed
+23
-17
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
69 | 71 | | |
| 72 | + | |
| 73 | + | |
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
| 207 | + | |
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| |||
0 commit comments