-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4c7f012
commit fcdd186
Showing
39 changed files
with
675 additions
and
494 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
Function Enable-GitHubWorkflow { | ||
<# | ||
.NOTES | ||
https://docs.github.com/en/rest/reference/actions#enable-a-workflow | ||
#> | ||
[CmdletBinding()] | ||
param ( | ||
[Parameter()] | ||
[string] $Owner = $script:Owner, | ||
|
||
[Parameter()] | ||
[string] $Repo = $script:Repo, | ||
|
||
[Parameter()] | ||
[string] $Token = $script:Token, | ||
|
||
[Parameter( | ||
Mandatory, | ||
ValueFromPipelineByPropertyName | ||
)] | ||
[string[]] $ID | ||
) | ||
|
||
begin {} | ||
|
||
process { | ||
$InputObject = @{ | ||
Token = $Token | ||
Method = 'PUT' | ||
APIEndpoint = "/repos/$Owner/$Repo/actions/workflows/$ID/enable" | ||
} | ||
|
||
$Response = Invoke-GitHubAPI @InputObject | ||
|
||
$Response | ||
} | ||
|
||
end {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
function Get-GitHubWorkflow { | ||
<# | ||
.NOTES | ||
https://docs.github.com/en/rest/reference/actions#list-repository-workflows | ||
#> | ||
[CmdletBinding(DefaultParameterSetName = 'ByName')] | ||
param ( | ||
[Parameter()] | ||
[string] $Owner = $script:Owner, | ||
|
||
[Parameter()] | ||
[string] $Repo = $script:Repo, | ||
|
||
[Parameter()] | ||
[string] $Token = $script:Token, | ||
|
||
[Parameter(ParameterSetName = 'ByName')] | ||
[string] $Name, | ||
|
||
[Parameter(ParameterSetName = 'ByID')] | ||
[string] $ID, | ||
|
||
[Parameter()] | ||
[int] $PageSize = 100 | ||
) | ||
|
||
$processedPages = 0 | ||
$workflows = @() | ||
do { | ||
$processedPages++ | ||
$InputObject = @{ | ||
Token = $Token | ||
Method = 'GET' | ||
APIEndpoint = "/repos/$Owner/$Repo/actions/workflows?per_page=$PageSize&page=$processedPages" | ||
} | ||
$Response = Invoke-GitHubAPI @InputObject -Verbose | ||
$workflows += $Response.workflows | Where-Object name -Match $name | Where-Object id -Match $id | ||
} while ($workflows.count -ne $Response.total_count) | ||
$workflows | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
Function Get-GitHubWorkflowRun { | ||
<# | ||
.NOTES | ||
https://docs.github.com/en/rest/reference/actions#list-workflow-runs-for-a-repository | ||
#> | ||
[CmdletBinding()] | ||
param ( | ||
[Parameter()] | ||
[string] $Owner = $script:Owner, | ||
|
||
[Parameter()] | ||
[string] $Repo = $script:Repo, | ||
|
||
[Parameter()] | ||
[string] $Token = $script:Token, | ||
|
||
[Parameter(ParameterSetName = 'ByName')] | ||
[string] $Name, | ||
|
||
[Parameter(ParameterSetName = 'ByID')] | ||
[string] $ID, | ||
|
||
[Parameter()] | ||
[int] $PageSize = 100 | ||
) | ||
|
||
$processedPages = 0 | ||
$workflowRuns = @() | ||
do { | ||
$processedPages++ | ||
$InputObject = @{ | ||
Token = $Token | ||
Method = 'GET' | ||
APIEndpoint = "/repos/$Owner/$Repo/actions/runs?per_page=$PageSize&page=$processedPages" | ||
} | ||
$Response = Invoke-GitHubAPI @InputObject | ||
$workflowRuns += $Response.workflows | Where-Object name -Match $name | Where-Object id -Match $id | ||
} until ($workflowRuns.count -eq $Response.total_count) | ||
$workflowRuns | ||
|
||
|
||
do { | ||
$WorkflowRuns = $Response.workflow_runs | ||
$Results += $WorkflowRuns | ||
} while ($WorkflowRuns.count -eq 100) | ||
return $Results | Where-Object Name -Match $Name | Where-Object workflow_id -Match $ID | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.