Skip to content

Commit 97c3846

Browse files
committed
20220113A
1 parent 3aab5d5 commit 97c3846

File tree

4 files changed

+29
-5
lines changed

4 files changed

+29
-5
lines changed

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ body:
1919
description: "What versions are affected? Versions must be listed as supported in the Security Policy (/.github/SECURITY.md)."
2020
multiple: true
2121
options:
22+
- "v0.3.0"
2223
- "v0.2.0"
23-
- "v0.1.0"
2424
validations:
2525
required: false
2626
- type: "textarea"

.github/SECURITY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
| **Tag / Version** | **Target** | **Support** |
1515
|:-:|:-:|:-:|
1616
| v0.X.X | PowerShell v7.2.0 | L |
17+
| < v0.2.X | PowerShell v7.2.0 | ❌{🐛🧓} |
1718

1819
## Report Vulnerability
1920

hugoalh.GitHubActionsToolkit/hugoalh.GitHubActionsToolkit.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
RootModule = 'hugoalh.GitHubActionsToolkit.psm1'
44

55
# Version number of this module.
6-
ModuleVersion = '0.2.0'
6+
ModuleVersion = '0.3.0'
77

88
# Supported PSEditions
99
# CompatiblePSEditions = @()

hugoalh.GitHubActionsToolkit/hugoalh.GitHubActionsToolkit.psm1

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,23 @@ function Format-GHActionsCommand {
4040
}
4141
<#
4242
.SYNOPSIS
43+
GitHub Actions - Internal - Get All Environment Variable
44+
.DESCRIPTION
45+
An internal function to get all environment variable.
46+
.OUTPUTS
47+
Hashtable
48+
#>
49+
function Get-AllEnvironmentVariable {
50+
[CmdletBinding()][OutputType([hashtable])]
51+
param ()
52+
[hashtable]$Result = @{}
53+
Get-ChildItem -Path 'Env:\' | ForEach-Object -Process {
54+
$Result[$_.Name] = $_.Value
55+
}
56+
return $Result
57+
}
58+
<#
59+
.SYNOPSIS
4360
GitHub Actions - Internal - Write Workflow Command
4461
.DESCRIPTION
4562
An internal function to write workflow command.
@@ -418,17 +435,23 @@ Set-Alias -Name 'Restore-GHActionsState' -Value 'Get-GHActionsState' -Option Rea
418435
GitHub Actions - Get Webhook Event Payload
419436
.DESCRIPTION
420437
Get the complete webhook event payload.
421-
.PARAMETER AsHashTable
438+
.PARAMETER AsHashtable
422439
Output as hashtable instead of object.
440+
.PARAMETER Depth
441+
Set the maximum depth the JSON input is allowed to have.
442+
.PARAMETER NoEnumerate
443+
Specify that output is not enumerated; Setting this parameter causes arrays to be sent as a single object instead of sending every element separately, this guarantees that JSON can be round-tripped via Cmdlet `ConvertTo-Json`.
423444
.OUTPUTS
424445
Hashtable | PSCustomObject
425446
#>
426447
function Get-GHActionsWebhookEventPayload {
427448
[CmdletBinding()][OutputType([hashtable], [pscustomobject])]
428449
param (
429-
[Alias('ToHashTable')][switch]$AsHashTable
450+
[Alias('ToHashtable')][switch]$AsHashtable,
451+
[int]$Depth = 1024,
452+
[switch]$NoEnumerate
430453
)
431-
return (Get-Content -Path $env:GITHUB_EVENT_PATH -Raw -Encoding utf8NoBOM | ConvertFrom-Json -AsHashtable:$AsHashTable)
454+
return ConvertFrom-Json -InputObject (Get-Content -Path $env:GITHUB_EVENT_PATH -Raw -Encoding utf8NoBOM) -AsHashtable:$AsHashtable -Depth $Depth -NoEnumerate:$NoEnumerate
432455
}
433456
Set-Alias -Name 'Get-GHActionsEvent' -Value 'Get-GHActionsWebhookEventPayload' -Option ReadOnly -Scope 'Local'
434457
Set-Alias -Name 'Get-GHActionsPayload' -Value 'Get-GHActionsWebhookEventPayload' -Option ReadOnly -Scope 'Local'

0 commit comments

Comments
 (0)