Skip to content

🩹 [Patch]: Fix classes and functions for Releases #347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 193 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
193 commits
Select commit Hold shift + click to select a range
5545d7d
Fix
MariusStorhaug Apr 11, 2025
f6c80c1
🩹 [Patch]: Add XML type definitions for GitHubWorkflow and GitHubWork…
MariusStorhaug Apr 11, 2025
fc39c44
🩹 [Patch]: Update parameter names and descriptions in artifact functi…
MariusStorhaug Apr 11, 2025
fa57a1a
🩹 [Patch]: Add input documentation and improve parameter binding in G…
MariusStorhaug Apr 11, 2025
8bf9c52
🩹 [Patch]: Remove default values for parameters in Get-GitHubMyReposi…
MariusStorhaug Apr 11, 2025
1c29467
🩹 [Patch]: Add input documentation and improve parameter binding in r…
MariusStorhaug Apr 11, 2025
c410328
🩹 [Patch]: Add parameter set for Organization and enhance Username pa…
MariusStorhaug Apr 11, 2025
a0b4a8e
🩹 [Patch]: Update Type parameter handling in Get-GitHubRepository fun…
MariusStorhaug Apr 11, 2025
fb48180
🩹 [Patch]: Enhance Save-GitHubArtifact function to include -Force par…
MariusStorhaug Apr 11, 2025
c12eb27
🩹 [Patch]: Refactor owner assignment logic in Get-GitHubRepository fu…
MariusStorhaug Apr 11, 2025
0b4ac2d
🩹 [Patch]: Update parameter attributes in Get-GitHubArtifact function…
MariusStorhaug Apr 11, 2025
dbd318b
🩹 [Patch]: Add Get-GitHubBranchList function to list branches from a …
MariusStorhaug Apr 11, 2025
0aa548a
🩹 [Patch]: Add GitHubEnvironment type definition with Environment scr…
MariusStorhaug Apr 11, 2025
e36bb1e
🩹 [Patch]: Update release functions to enhance documentation and impr…
MariusStorhaug Apr 11, 2025
bf8ffc6
🩹 [Patch]: Rename ReleaseAsset class to GitHubReleaseAsset for consis…
MariusStorhaug Apr 11, 2025
8ea0b60
🩹 [Patch]: Add Assets property to GitHubRelease class to store upload…
MariusStorhaug Apr 11, 2025
433edd6
🩹 [Patch]: Modify error handling in Get-GitHubRepository function to …
MariusStorhaug Apr 11, 2025
32e7753
🩹 [Patch]: Add GitHubRelease format configuration for table and list …
MariusStorhaug Apr 11, 2025
4cc9a30
🩹 [Patch]: Update property mappings in GitHubRelease and GitHubWorkfl…
MariusStorhaug Apr 11, 2025
f3efc9c
🩹 [Patch]: Add Latest property to GitHubRelease class and update rela…
MariusStorhaug Apr 11, 2025
f7da76e
🩹 [Patch]: Update Get-GitHubReleaseLatest to instantiate GitHubReleas…
MariusStorhaug Apr 11, 2025
498f440
🩹 [Patch]: Rename TagName property to Tag in GitHubRelease class and …
MariusStorhaug Apr 11, 2025
4531715
🩹 [Patch]: Add example commands for creating and managing a GitHub re…
MariusStorhaug Apr 11, 2025
cce05d8
🩹 [Patch]: Refactor GitHub release functions to include error handlin…
MariusStorhaug Apr 12, 2025
f6eb2dc
🩹 [Patch]: Update SaveArtifacts.ps1 to include Get-GitHubWorkflowRun …
MariusStorhaug Apr 12, 2025
cb18efa
🩹 [Patch]: Update SaveArtifacts.ps1 to create a new GitHub release wi…
MariusStorhaug Apr 12, 2025
4e494c2
🩹 [Patch]: Update GitHubRelease instantiation in multiple release ret…
MariusStorhaug Apr 12, 2025
1b021e8
🩹 [Patch]: Update New-GitHubRelease to simplify Latest parameter hand…
MariusStorhaug Apr 12, 2025
fa5a66b
🩹 [Patch]: Update SaveArtifacts.ps1 to change release tag from 'v1.0'…
MariusStorhaug Apr 12, 2025
541fccf
🩹 [Patch]: Update SaveArtifacts.ps1 to change release tag from 'v1.1'…
MariusStorhaug Apr 12, 2025
0b19339
🩹 [Patch]: Update SaveArtifacts.ps1 to change release tag to 'v1.6.3'…
MariusStorhaug Apr 12, 2025
62e96d8
🩹 [Patch]: Update SaveArtifacts.ps1 to remove unnecessary blank lines…
MariusStorhaug Apr 12, 2025
a0d3077
🩹 [Patch]: Update GitHubRelease.Format.ps1xml to remove 'Author' colu…
MariusStorhaug Apr 12, 2025
cc3ca5d
🩹 [Patch]: Update SaveArtifacts.ps1 to add new GitHub API calls for b…
MariusStorhaug Apr 12, 2025
a11dfaf
🩹 [Patch]: Refactor SaveArtifacts.ps1 to streamline GitHub release co…
MariusStorhaug Apr 12, 2025
0bd3867
🩹 [Patch]: Clean up SaveArtifacts.ps1 by removing unused GitHub comma…
MariusStorhaug Apr 12, 2025
74aa828
Update Releases.ps1 to include debug option for Get-GitHubRelease; mo…
MariusStorhaug Apr 12, 2025
85a0bdc
🩹 [Patch]: Update Releases.ps1 to include release name for v1.4; modi…
MariusStorhaug Apr 12, 2025
13756c7
🩹 [Feature]: Add Set-GitHubRelease function to create or update GitHu…
MariusStorhaug Apr 12, 2025
14990b8
🩹 [Patch]: Remove unused code from SaveArtifacts.ps1; update Releases…
MariusStorhaug Apr 12, 2025
203cc07
🩹 [Patch]: Enhance Set-GitHubRelease and Update-GitHubRelease functio…
MariusStorhaug Apr 12, 2025
4f27a0b
🩹 [Patch]: Add missing code to SaveArtifacts.ps1 for retrieving and s…
MariusStorhaug Apr 12, 2025
a993f7c
🩹 [Patch]: Simplify error handling in Invoke-GitHubAPI by replacing c…
MariusStorhaug Apr 12, 2025
1a2f70e
🩹 [Patch]: Simplify error output formatting in Invoke-GitHubAPI by re…
MariusStorhaug Apr 12, 2025
9a3e7ec
🩹 [Patch]: Simplify error output formatting in Invoke-GitHubAPI by re…
MariusStorhaug Apr 12, 2025
c82b98a
🩹 [Patch]: Improve error handling in Invoke-GitHubAPI by replacing th…
MariusStorhaug Apr 12, 2025
f871930
🩹 [Patch]: Enhance error handling in Invoke-GitHubAPI by writing erro…
MariusStorhaug Apr 12, 2025
0f08624
🩹 [Patch]: Remove redundant error writing in Invoke-GitHubAPI to stre…
MariusStorhaug Apr 12, 2025
21662cf
Refactor Update-GitHubRelease to set Draft and Prerelease flags based…
MariusStorhaug Apr 12, 2025
3c4ba5c
🩹 [Patch]: Update parameter sets in Set-GitHubRelease and Update-GitH…
MariusStorhaug Apr 12, 2025
b720530
🩹 [Patch]: Update Set-GitHubRelease to directly assign Latest paramet…
MariusStorhaug Apr 12, 2025
78ca435
Refactor Set-GitHubRelease to conditionally assign Latest, Draft, and…
MariusStorhaug Apr 12, 2025
8b3076e
Enhance Set-GitHubRelease to include output formatting for release de…
MariusStorhaug Apr 12, 2025
acf2090
Refactor Set-GitHubRelease to streamline release updates by consolida…
MariusStorhaug Apr 12, 2025
256b99a
Refactor New-GitHubRepositoryAsFork to rename Owner parameter to Orga…
MariusStorhaug Apr 13, 2025
14c27e6
Refactor user retrieval functions to handle different response types …
MariusStorhaug Apr 13, 2025
5e0e26c
Refactor user response handling in Get-GitHubAllUser, Get-GitHubMyUse…
MariusStorhaug Apr 13, 2025
bf709a0
Enhance Set-GitHubRelease to retrieve repository details and conditio…
MariusStorhaug Apr 13, 2025
b9cc3dd
Refactor Set-GitHubRelease and Update-GitHubRelease to streamline par…
MariusStorhaug Apr 13, 2025
2b6fe0f
Refactor Get-GitHubRepository to initialize Affiliation parameter wit…
MariusStorhaug Apr 13, 2025
2f43d87
Refactor Update-GitHubRelease to set default values for draft and pre…
MariusStorhaug Apr 13, 2025
6fc3820
Refactor Set-GitHubRelease and Update-GitHubRelease to include -Error…
MariusStorhaug Apr 13, 2025
c92f1b2
Refactor Get-GitHubRelease to update parameter set names for clarity,…
MariusStorhaug Apr 13, 2025
0841fa4
Refactor Get-GitHubOrganization to add an alias for the Username para…
MariusStorhaug Apr 13, 2025
8af9437
Refactor Get-GitHubRelease examples for clarity and update Get-GitHub…
MariusStorhaug Apr 13, 2025
acf5db4
Refactor Get-GitHubRepository to add an alias for the Username parame…
MariusStorhaug Apr 13, 2025
a8a1ba2
Refactor Set-GitHubRelease parameters to provide default values for N…
MariusStorhaug Apr 13, 2025
e82e933
Refactor Get-GitHubRelease examples for improved clarity and performa…
MariusStorhaug Apr 13, 2025
1e168f4
Refactor SaveArtifacts and Releases examples for improved clarity and…
MariusStorhaug Apr 13, 2025
f0d0159
Refactor release management examples for improved clarity and consist…
MariusStorhaug Apr 13, 2025
29066b1
Refactor release note handling in New-GitHubReleaseNote and Update-Gi…
MariusStorhaug Apr 13, 2025
6334dce
Refactor New-GitHubRepository parameters for consistency by renaming …
MariusStorhaug Apr 13, 2025
6e05f19
Refactor New-GitHubRepository and New-GitHubRepositoryAsFork paramete…
MariusStorhaug Apr 13, 2025
03c918a
Refactor release creation logic in Update-GitHubRelease to conditiona…
MariusStorhaug Apr 13, 2025
7676721
Add GenerateReleaseNotes parameter to Set-GitHubRelease for automatic…
MariusStorhaug Apr 13, 2025
fb02429
fix
MariusStorhaug Apr 13, 2025
c279efc
Enhance release management by adding Set-GitHubRelease for version 1.…
MariusStorhaug Apr 13, 2025
7c1c1a6
Enhance Update-GitHubRelease to require either ID or Tag parameter an…
MariusStorhaug Apr 13, 2025
558557f
Fix Update-GitHubRelease to reset Tag parameter when ID is not provid…
MariusStorhaug Apr 13, 2025
1e88d28
Refactor Update-GitHubRelease to simplify parameter checks and improv…
MariusStorhaug Apr 13, 2025
77b67d0
Improve Update-GitHubRelease to handle missing ID when Tag is provide…
MariusStorhaug Apr 13, 2025
f3fd5a8
Refactor Update-GitHubRelease to streamline body parameter constructi…
MariusStorhaug Apr 13, 2025
3c4e930
Refactor Update-GitHubRelease to remove mandatory constraint on ID pa…
MariusStorhaug Apr 13, 2025
c656b07
Add InputObject parameter to Update-GitHubRelease for improved releas…
MariusStorhaug Apr 13, 2025
d5758e5
Add Get-GitHubReleaseAsset usage example and improve parameter docume…
MariusStorhaug Apr 14, 2025
8754a93
Enhance GitHubRepository and related functions with additional proper…
MariusStorhaug Apr 14, 2025
d6ccf3c
Remove HasDownloads parameter from repository creation functions and …
MariusStorhaug Apr 14, 2025
a13bef2
Update sorting parameters to default to 'pushed' and enhance document…
MariusStorhaug Apr 14, 2025
dbfad73
Set default parameter values for Visibility, Affiliation, Type, and S…
MariusStorhaug Apr 14, 2025
fc14d07
Refactor GitHubNode subclasses to use databaseId for ID assignment; e…
MariusStorhaug Apr 15, 2025
6ffbc60
Add Latest parameter to GitHubRelease constructor for improved releas…
MariusStorhaug Apr 15, 2025
c59cdd0
Update Invoke-GitHubAPI documentation to include LINK section and cor…
MariusStorhaug Apr 15, 2025
dba6453
Fix PerPage assignment logic in Get-GitHubReleaseQL to ensure correct…
MariusStorhaug Apr 15, 2025
a7eaebf
Refactor Get-GitHubReleaseQL to simplify asset handling and improve q…
MariusStorhaug Apr 15, 2025
47f328f
Remove unused asset query and related code from Get-GitHubReleaseQL t…
MariusStorhaug Apr 15, 2025
76b8fe5
Add detailed release asset fields to Get-GitHubReleaseQL query for en…
MariusStorhaug Apr 15, 2025
58e6228
Add additional asset fields to Get-GitHubReleaseQL query for enhanced…
MariusStorhaug Apr 15, 2025
11fe72f
Enhance Get-GitHubReleaseQL query to include detailed uploadedBy fiel…
MariusStorhaug Apr 15, 2025
976a69d
Rename parameter $InputObject to $ReleaseObject in Update-GitHubRelea…
MariusStorhaug Apr 15, 2025
58346bb
Refactor Get-GitHubReleaseQL function for improved asset pagination a…
MariusStorhaug Apr 15, 2025
8a044d0
Add newline at the end of SaveArtifacts.ps1 for better file formatting
MariusStorhaug Apr 15, 2025
0c6d0ef
Refactor error handling in Get-GitHubReleaseAll to use finally block …
MariusStorhaug Apr 15, 2025
9e90f51
Refactor Get-GitHubReleaseAll to simplify response handling and impro…
MariusStorhaug Apr 15, 2025
97da298
Add initial Pester tests for GitHub API interactions
MariusStorhaug Apr 15, 2025
1f1aedb
Enhance Releases.Tests.ps1 to include a test for New-GitHubRelease an…
MariusStorhaug Apr 15, 2025
ce70ac0
Refactor Resolve-GitHubContext and Resolve-GitHubContextSetting for i…
MariusStorhaug Apr 15, 2025
aea6f40
Refactor Invoke-GitHubAPI to conditionally resolve GitHub context bas…
MariusStorhaug Apr 15, 2025
d9448ba
Refactor parameter handling in Resolve-GitHubContext and Invoke-GitHu…
MariusStorhaug Apr 15, 2025
8ce3929
Enhance debugging output in Resolve-GitHubContextSetting; update test…
MariusStorhaug Apr 15, 2025
4b99ada
Add Initialize-GitHubConfig function to initialize GitHub configuration
MariusStorhaug Apr 15, 2025
f84d65d
Enhance Resolve-GitHubContextSetting with improved debug output for d…
MariusStorhaug Apr 15, 2025
c7f229c
Add ApiBaseUri property to GitHubConfig and correct its assignment in…
MariusStorhaug Apr 15, 2025
ab64c42
Add Initialize-GitHubConfig function to initialize GitHub module conf…
MariusStorhaug Apr 15, 2025
8a63be8
Refactor GitHub module configuration and enhance New-GitHubRepository…
MariusStorhaug Apr 15, 2025
a82a568
Remove Initialize-GitHubConfig function from the initialization script
MariusStorhaug Apr 15, 2025
c771886
Refactor Invoke-GitHubAPI to streamline context resolution; remove un…
MariusStorhaug Apr 15, 2025
fb214db
Refactor Invoke-GitHubAPI to initialize GitHub configuration for anon…
MariusStorhaug Apr 15, 2025
7702286
Refactor Invoke-GitHubAPI to utilize Resolve-GitHubContextSetting for…
MariusStorhaug Apr 15, 2025
8c2cbe7
Refactor Resolve-GitHubContextSetting to simplify value checking; rep…
MariusStorhaug Apr 15, 2025
c7efa12
Refactor Resolve-GitHubContextSetting to enhance context validation; …
MariusStorhaug Apr 15, 2025
351b0a5
Refactor Resolve-GitHubContextSetting to improve context validation; …
MariusStorhaug Apr 15, 2025
dcb8eeb
Refactor Invoke-GitHubAPI to conditionally set authentication for non…
MariusStorhaug Apr 15, 2025
33fffc6
Refactor Invoke-GitHubAPI to remove the ad-hoc token parameter; strea…
MariusStorhaug Apr 15, 2025
dc31332
Refactor New-GitHubRepository and Get-GitHubRepository filters; remov…
MariusStorhaug Apr 15, 2025
7f6529a
Merge branch 'main' of https://github.com/PSModule/GitHub into releases
MariusStorhaug Apr 16, 2025
40f2598
Merge branch 'main' of https://github.com/PSModule/GitHub into releases
MariusStorhaug Apr 23, 2025
f1ba156
Add Pester tests for GitHub API functionalities
MariusStorhaug Apr 27, 2025
1ec6bf2
Merge branch 'main' of https://github.com/PSModule/GitHub into releases
MariusStorhaug Apr 27, 2025
458fda7
Add initial test scripts for GitHub API functionalities
MariusStorhaug Apr 27, 2025
1ed9d01
Refactor parameter aliases for GitHub release functions to consolidat…
MariusStorhaug Apr 27, 2025
a30eb5f
Fix formatting and adjust context skip condition in Releases tests
MariusStorhaug Apr 27, 2025
2154097
Add tests for New-GitHubRelease function to validate release creation…
MariusStorhaug Apr 27, 2025
0adb584
Refactor New-GitHubRelease tests to use consistent variable naming an…
MariusStorhaug Apr 27, 2025
9151693
Add debug flag to Get-GitHubRelease test for improved output visibility
MariusStorhaug Apr 27, 2025
7fefb5e
Update Get-GitHubRelease cmdlet to support 'AllVersions' parameter an…
MariusStorhaug Apr 27, 2025
e5d372f
Enhance Releases tests to validate Get-GitHubRelease functionality an…
MariusStorhaug Apr 27, 2025
5decbd0
Update Get-GitHubRelease documentation and enhance Releases tests for…
MariusStorhaug Apr 27, 2025
6945217
Comment out Update-GitHubRelease test case for future reference
MariusStorhaug Apr 27, 2025
848488f
Refactor Releases tests to correct context usage and restore Update-G…
MariusStorhaug Apr 27, 2025
08ed72a
Enhance Update-GitHubRelease cmdlet documentation and add debug param…
MariusStorhaug Apr 27, 2025
4edcfb4
Update Update-GitHubRelease test case to include -Confirm parameter
MariusStorhaug Apr 27, 2025
de9425d
Refactor Update-GitHubRelease parameters to use nullable switches and…
MariusStorhaug Apr 27, 2025
5480e4b
Add tests for Update-GitHubRelease to validate updates for releases v…
MariusStorhaug Apr 27, 2025
79c643f
Remove assertion for release tag in New-GitHubRelease test case
MariusStorhaug Apr 27, 2025
92033c8
Refactor Update-GitHubRelease tests to improve coverage and add new s…
MariusStorhaug Apr 27, 2025
f659057
Update Get-GitHubRelease test to assert that v1.0 is no longer the la…
MariusStorhaug Apr 27, 2025
a624995
Update Remove-GitHubRelease test to use ID parameter instead of Tag
MariusStorhaug Apr 27, 2025
c8910ab
Enhance Add-GitHubReleaseAsset to support directory uploads and impro…
MariusStorhaug Apr 27, 2025
ef29843
Auto-generated changes
github-actions[bot] Apr 27, 2025
c785111
Add argument completer for Owner parameter in GitHub commands
MariusStorhaug Apr 28, 2025
9d95f14
Refactor argument completers: remove unused Owner completer and add G…
MariusStorhaug Apr 28, 2025
764d2f2
Refactor Get-GitHubOrganization argument completer to improve context…
MariusStorhaug Apr 28, 2025
333bad3
Improve completion result formatting in Get-GitHubOrganization argume…
MariusStorhaug Apr 28, 2025
255ff90
Refactor Get-GitHubOrganization: update default parameter set and add…
MariusStorhaug Apr 28, 2025
d165a9e
Refactor argument completers: add Owner parameter completer and impro…
MariusStorhaug Apr 28, 2025
ba702bd
Refactor Get-GitHubRelease calls to remove unnecessary -Latest parame…
MariusStorhaug Apr 28, 2025
44f0f02
Refactor Invoke-GitHubAPI: streamline URI construction and improve ha…
MariusStorhaug Apr 28, 2025
45cf3d9
Fix variable reference in content type determination for uploaded fil…
MariusStorhaug Apr 28, 2025
b6246db
Add ContentType parameter to Add-GitHubReleaseAsset for payload speci…
MariusStorhaug Apr 28, 2025
90e5e80
Refactor Get-GitHubReleaseAll to handle response correctly and update…
MariusStorhaug Apr 28, 2025
b3ad996
Refactor Get-GitHubReleaseAll to improve readability by replacing a n…
MariusStorhaug Apr 28, 2025
c4b292a
Add GitHubReleaseAsset class to manage release assets with properties…
MariusStorhaug Apr 28, 2025
4c408af
Auto-generated changes
github-actions[bot] Apr 28, 2025
456b9f4
Refactor Get-GitHubReleaseAll to support paging and improve perPage p…
MariusStorhaug Apr 28, 2025
1c52b95
Update PerPage parameter handling to allow zero value and adjust vali…
MariusStorhaug Apr 28, 2025
f3a32a4
Fix Update-GitHubRelease to use IsLatest property for determining rel…
MariusStorhaug Apr 28, 2025
d699f1e
Update assertions in Releases.Tests.ps1 to use Should -BeTrue and Sho…
MariusStorhaug Apr 28, 2025
eb667c3
Remove mandatory ID parameter from Add-GitHubReleaseAsset and streaml…
MariusStorhaug Apr 28, 2025
340d0a8
Refactor Add-GitHubReleaseAsset to remove mandatory ID parameter and …
MariusStorhaug Apr 28, 2025
51e882d
Enhance GitHubReleaseAsset and related functions: update property typ…
MariusStorhaug Apr 28, 2025
f7bd454
Refactor Get-GitHubReleaseAsset to support asset retrieval by name an…
MariusStorhaug Apr 29, 2025
665c18f
Add tests for GitHub release asset management: create, retrieve, upda…
MariusStorhaug Apr 29, 2025
71efe23
Refactor asset test cases in Releases.Tests.ps1: standardize string q…
MariusStorhaug Apr 29, 2025
c760b45
Add tests for Add-GitHubReleaseAsset: create asset with custom parame…
MariusStorhaug Apr 29, 2025
a77bbef
Refactor Add-GitHubReleaseAsset calls in tests: replace -FilePath wit…
MariusStorhaug Apr 29, 2025
5659507
Refactor Add-GitHubReleaseAsset and Remove-GitHubReleaseAsset: stream…
MariusStorhaug Apr 30, 2025
8928a16
Auto-generated changes
github-actions[bot] Apr 30, 2025
7c03a3d
Update test for Add-GitHubReleaseAsset: change asset file path to use…
MariusStorhaug Apr 30, 2025
11cbeb0
Update test for asset name validation: change expected asset name to …
MariusStorhaug Apr 30, 2025
2142440
Update Add-GitHubReleaseAsset test: use variable for file name and va…
MariusStorhaug Apr 30, 2025
4988567
Update Add-GitHubReleaseAsset test: validate asset properties and rei…
MariusStorhaug Apr 30, 2025
f5437fe
Update Add-GitHubReleaseAsset tests: validate asset content type and …
MariusStorhaug Apr 30, 2025
9e59c24
Update Releases.Tests: modify asset content validation and adjust tem…
MariusStorhaug Apr 30, 2025
7c8f597
Update Releases.Tests: refactor asset handling to use temporary direc…
MariusStorhaug Apr 30, 2025
b71a92b
Update Releases.Tests: enhance release asset tests with structured te…
MariusStorhaug Apr 30, 2025
462549a
Update Releases.Tests: change test folder path to use script root ins…
MariusStorhaug Apr 30, 2025
929cf1a
Update Releases.Tests: remove redundant cleanup logic from AfterAll b…
MariusStorhaug Apr 30, 2025
7d39d68
Update Releases.Tests: change zip file path to use script root instea…
MariusStorhaug Apr 30, 2025
623214f
Update Releases.Tests: change download path to use script root instea…
MariusStorhaug Apr 30, 2025
ff2011b
Update Get-GitHubReleaseAsset: change parameter usage from ReleaseID …
MariusStorhaug Apr 30, 2025
80434d4
Update Releases.Tests: add retry logic to Invoke-WebRequest for asset…
MariusStorhaug Apr 30, 2025
c3190e9
Update asset retrieval functions: enhance output type handling and im…
MariusStorhaug Apr 30, 2025
5bdd741
Update Get-GitHubReleaseAsset: enhance parameter handling and add sup…
MariusStorhaug Apr 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/PSModule.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
Test:
SourceCode:
Skip: true
PSModule:
Skip: true
Module:
Windows:
Skip: true
MacOS:
Skip: true
CodeCoverage:
PercentTarget: 40
Skip: true
PercentTarget: 50
TestResults:
Skip: true
Build:
Docs:
Skip: true
15 changes: 8 additions & 7 deletions Coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
<table>
<tr>
<td>Available functions</td>
<td>1026</td>
<td>1027</td>
</tr>
<tr>
<td>Covered functions</td>
<td>221</td>
<td>220</td>
</tr>
<tr>
<td>Missing functions</td>
<td>805</td>
<td>807</td>
</tr>
<tr>
<td>Coverage</td>
<td>21.54%</td>
<td>21.42%</td>
</tr>
</table>

Expand Down Expand Up @@ -51,6 +51,7 @@
| `/classrooms/{classroom_id}/assignments` | | :x: | | | |
| `/codes_of_conduct` | | :x: | | | |
| `/codes_of_conduct/{key}` | | :x: | | | |
| `/credentials/revoke` | | | | :x: | |
| `/emojis` | | :white_check_mark: | | | |
| `/enterprises/{enterprise}/code-security/configurations` | | :x: | | :x: | |
| `/enterprises/{enterprise}/code-security/configurations/defaults` | | :x: | | | |
Expand Down Expand Up @@ -539,10 +540,10 @@
| `/repos/{owner}/{repo}/releases` | | :white_check_mark: | | :white_check_mark: | |
| `/repos/{owner}/{repo}/releases/assets/{asset_id}` | :white_check_mark: | :white_check_mark: | :white_check_mark: | | |
| `/repos/{owner}/{repo}/releases/generate-notes` | | | | :white_check_mark: | |
| `/repos/{owner}/{repo}/releases/latest` | | :white_check_mark: | | | |
| `/repos/{owner}/{repo}/releases/tags/{tag}` | | :white_check_mark: | | | |
| `/repos/{owner}/{repo}/releases/latest` | | :x: | | | |
| `/repos/{owner}/{repo}/releases/tags/{tag}` | | :x: | | | |
| `/repos/{owner}/{repo}/releases/{release_id}` | :white_check_mark: | :white_check_mark: | :white_check_mark: | | |
| `/repos/{owner}/{repo}/releases/{release_id}/assets` | | :white_check_mark: | | :x: | |
| `/repos/{owner}/{repo}/releases/{release_id}/assets` | | :white_check_mark: | | :white_check_mark: | |
| `/repos/{owner}/{repo}/releases/{release_id}/reactions` | | :x: | | :x: | |
| `/repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}` | :x: | | | | |
| `/repos/{owner}/{repo}/rules/branches/{branch}` | | :x: | | | |
Expand Down
60 changes: 60 additions & 0 deletions examples/Releases/Releases.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Get all the releases for a specific repository
Get-GitHubRelease -Owner PSModule -Repository GitHub

# Get the latest release for a specific repository
Get-GitHubRelease -Owner PSModule -Repository GitHub

# Get all the releases for all repos in the organization
'PSModule' | Get-GitHubOrganization | Get-GitHubRepository | Get-GitHubRelease

# Get the latest releases for all repos in the organization
'PSModule' | Get-GitHubOrganization | Get-GitHubRepository | ForEach-Object -ThrottleLimit ([Environment]::ProcessorCount) -Parallel {
do {
Import-Module -Name GitHub
} until ($? -eq $true)
$_ | Get-GitHubRelease
}

'PSModule' | Get-GitHubOrganization | Get-GitHubRepository | Get-GitHubRelease -Latest
Get-GitHubUser | Get-GitHubRepository | Get-GitHubRelease -Latest

# Create a new release for a specific repository
$repoName = 'mytest'

$repo = Get-GitHubUser | Get-GitHubRepository -Name $repoName
$repo | Get-GitHubRelease
$repo | New-GitHubRelease -Tag 'v1.0' -Latest
$repo | New-GitHubRelease -Tag 'v1.1' -Latest -Name 'test'
$repo | New-GitHubRelease -Tag 'v1.2' -Latest -Name 'test' -Notes 'Release notes'
$repo | New-GitHubRelease -Tag 'v1.3' -Latest -Name 'test' -GenerateReleaseNotes
$repo | Get-GitHubRelease -Tag 'v1.3' | Format-List
$repo | Get-GitHubRelease -Tag 'v1.3' | Update-GithubRelease -Notes 'Release notes1'
$repo | Update-GitHubRelease -Tag 'v1.3' -Name 'test123' -Debug

$repo | New-GitHubRelease -Tag 'v1.3.2' -Latest -GenerateReleaseNotes -Debug
$repo | Get-GitHubRelease -Tag 'v1.3.1' | Format-List
$repo | Set-GitHubRelease -Tag 'v1.3.1' -Latest -GenerateReleaseNotes -Debug
$repo | Set-GitHubRelease -Tag 'v1.3.1' -Latest -GenerateReleaseNotes -Notes 'Release notes'
$repo | Get-GitHubRelease -Tag 'v1.3.1' | Format-List
Get-GitHubReleaseAsset -Owner MariusStorhaug -Repository mytest -ReleaseID

$repo | Set-GitHubRelease -Tag 'v1.5' -Latest -Name 'test' -Notes 'Release notes' | Select-Object *
$repo | Get-GitHubRelease -Tag 'v1.4' | Select-Object Tag, Name, Latest, Prerelease, Draft
$repo | Set-GitHubRelease -Tag 'v1.4' | Select-Object Tag, Name, Latest, Prerelease, Draft
$repo | Set-GitHubRelease -Tag 'v1.4' -Name 'test2' -Draft | Select-Object Tag, Name, Latest, Prerelease, Draft
$repo | Set-GitHubRelease -Tag 'v1.4' -Name 'test2' -Draft -Prerelease | Select-Object Tag, Name, Latest, Prerelease, Draft
$repo | Set-GitHubRelease -Tag 'v1.4' -Name 'test2' -Prerelease | Select-Object Tag, Name, Latest, Prerelease, Draft
$repo | Set-GitHubRelease -Tag 'v1.4' -Name 'test2' -Latest | Select-Object Tag, Name, Latest, Prerelease, Draft
$repo | Set-GitHubRelease -Tag 'v1.4' -Name 'test2' | Select-Object Tag, Name, Latest, Prerelease, Draft

$repo | Get-GitHubRelease -Tag 'v1.4' | Select-Object *

$repo | Set-GitHubRelease -Tag 'v1.4' -Name 'test2'


New-GitHubReleaseNote -Owner PSModule -Repository GitHub -Tag 'v0.22.0' -Target 'main' -PreviousTag 'v0.20.0' | Format-List

$repo | Get-GitHubRelease | Remove-GitHubRelease


$repo | Remove-GitHubRepository -Confirm:$false
93 changes: 93 additions & 0 deletions src/classes/public/Releases/GitHubRelease.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
class GitHubRelease : GitHubNode {
# Name of the release, can be null
# Example: "v0.22.1"
[string] $Name

# The repository where the environment is.
[string] $Repository

# The owner of the environment.
[string] $Owner

# The name of the tag
# Example: "v0.22.1"
[string] $Tag

# Release notes or changelog, can be null
# Example: "## What's Changed\n### Other Changes\n* Fix: Enhance repository deletion feedback and fix typo..."
[string] $Notes

# Specifies the commitish value that determines where the Git tag is created from
# Example: "main"
[string] $Target

# True if the release is the latest release on the repo.
# Example: true
[bool] $IsLatest

# True to create a draft (unpublished) release, false to create a published one
# Example: false
[bool] $IsDraft

# Whether to identify the release as a prerelease or a full release
# Example: false
[bool] $IsPrerelease

# GitHub URL for the release
# Example: "https://github.com/PSModule/GitHub/releases/tag/v0.22.1"
[string] $Url

# User who authored the release
[GitHubUser] $Author

# Timestamp when the release was created
# Example: "2025-04-11T09:03:38Z"
[System.Nullable[datetime]] $CreatedAt

# Timestamp when the release was published
# Example: "2025-04-11T13:41:34Z"
[System.Nullable[datetime]] $PublishedAt

# Timestamp when the release was updated
# Example: "2025-04-11T13:41:34Z"
[System.Nullable[datetime]] $UpdatedAt

GitHubRelease() {}

GitHubRelease([PSCustomObject] $Object, [string] $Owner, [string] $Repository, [System.Nullable[bool]] $Latest) {
if ($null -ne $Object.node_id) {
$this.ID = $Object.id
$this.NodeID = $Object.node_id
$this.Tag = $Object.tag_name
$this.Name = $Object.name
$this.Notes = $Object.body
$this.IsLatest = $Latest
$this.IsDraft = $Object.draft
$this.IsPrerelease = $Object.prerelease
$this.Url = $Object.html_url
$this.Owner = $Owner
$this.Repository = $Repository
$this.Target = $Object.target_commitish
$this.CreatedAt = $Object.created_at
$this.PublishedAt = $Object.published_at
$this.Author = [GitHubUser]::new($Object.author)
} else {
$this.ID = $Object.databaseId
$this.NodeID = $Object.id
$this.Tag = $Object.tagName
$this.Name = $Object.name
$this.Notes = $Object.description
$this.IsLatest = $Object.isLatest
$this.IsDraft = $Object.isDraft
$this.IsPrerelease = $Object.isPrerelease
$this.Url = $Object.url
$this.Owner = $Owner
$this.Repository = $Repository
# $this.Target = $Object.target_commitish
$this.CreatedAt = $Object.createdAt
$this.PublishedAt = $Object.publishedAt
$this.UpdatedAt = $Object.updatedAt
$this.Author = [GitHubUser]::new($Object.author)
}
}
}
73 changes: 73 additions & 0 deletions src/classes/public/Releases/GitHubReleaseAsset.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
class GitHubReleaseAsset : GitHubNode {
# Description: URL for downloading the asset
# Example: "https://github.com/PSModule/GitHub/releases/download/v0.22.1/asset.zip"
[string] $Url

# Description: The file name of the asset
# Example: "Team Environment"
[string] $Name

# Description: Label for the asset, can be null
# Example: null
[string] $Label

# Description: State of the release asset (e.g., uploaded, open)
# Example: "uploaded"
[string] $State

# Description: MIME type of the asset
# Example: "application/zip"
[string] $ContentType

# Description: Size of the asset in bytes
# Example: 1024
[int] $Size

# Description: Number of times the asset was downloaded
# Example: 100
[int] $Downloads

# Description: Timestamp when the asset was created
# Example: "2025-04-11T09:03:38Z"
[System.Nullable[datetime]] $CreatedAt

# Description: Timestamp when the asset was last updated
# Example: "2025-04-11T09:03:38Z"
[System.Nullable[datetime]] $UpdatedAt

# Description: User who uploaded the asset, can be null
# Example: GitHubUser object or null
[GitHubUser] $UploadedBy

GitHubReleaseAsset() {}

GitHubReleaseAsset([PSCustomObject]$Object) {
if ($null -ne $Object.node_id) {
$this.ID = $Object.id
$this.NodeID = $Object.node_id
$this.Url = $Object.browser_download_url
$this.Name = $Object.name
$this.Label = $Object.label
$this.State = $Object.state
$this.ContentType = $Object.content_type
$this.Size = $Object.size
$this.Downloads = $Object.download_count
$this.CreatedAt = [datetime]::Parse($Object.created_at)
$this.UpdatedAt = [datetime]::Parse($Object.updated_at)
$this.UploadedBy = [GitHubUser]::new($Object.uploader)
} else {
$this.ID = $Object.databaseId
$this.NodeID = $Object.id
$this.Url = $Object.downloadUrl
$this.Name = $Object.name
$this.Label = $Object.label
$this.State = $Object.state
$this.ContentType = $Object.contentType
$this.Size = $Object.size
$this.Downloads = $Object.downloadCount
$this.CreatedAt = [datetime]::Parse($Object.createdAt)
$this.UpdatedAt = [datetime]::Parse($Object.updatedAt)
$this.UploadedBy = [GitHubUser]::new($Object.uploadedBy)
}
}
}
Loading
Loading