Skip to content

Commit 6065db0

Browse files
(GHA) Update casing and fix authorization (MicrosoftDocs#12253)
Prior to this change, the authorization parameter handling didn't correctly handle an empty string for the `authorized_accounts` parameter. The casing for all other workflows used incorrect casing for workflow parameters, like `Message_Body` instead of `message_body`. This change: - Corrects the casing of all parameter handler entries. - Ensures that the parameter handler for `authorized_accounts` only passes the parameter to the action script when the input value is a non-empty string.
1 parent 7b86980 commit 6065db0

File tree

5 files changed

+20
-17
lines changed

5 files changed

+20
-17
lines changed

.github/actions/commenting/expectations/v1/Parameters.psd1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@{
22
Parameters = @(
33
@{
4-
Name = 'Repository'
4+
Name = 'repository'
55
Type = 'string'
66
IfNullOrEmpty = {
77
param($ErrorTarget)
@@ -31,7 +31,7 @@
3131
}
3232

3333
@{
34-
Name = 'Message_Body'
34+
Name = 'message_body'
3535
Type = 'String'
3636
IfNullOrEmpty = {
3737
param($ErrorTarget)
@@ -75,7 +75,7 @@
7575
}
7676

7777
@{
78-
Name = 'Message_Path'
78+
Name = 'message_path'
7979
Type = 'String'
8080
IfNullOrEmpty = {
8181
param($ErrorTarget)

.github/actions/reporting/stale-content/v1/Parameters.psd1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@{
22
Parameters = @(
33
@{
4-
Name = 'Relative_Folder_Path'
4+
Name = 'relative_folder_path'
55
Type = 'String[]'
66
IfNullOrEmpty = {
77
param($ErrorTarget)
@@ -33,7 +33,7 @@
3333
}
3434

3535
@{
36-
Name = 'Exclude_Folder_Segment'
36+
Name = 'exclude_folder_segment'
3737
Type = 'String[]'
3838
IfNullOrEmpty = {
3939
param($ErrorTarget)
@@ -56,7 +56,7 @@
5656
}
5757

5858
@{
59-
Name = 'Days_Until_Stale'
59+
Name = 'days_until_stale'
6060
Type = 'Int'
6161
IfNullOrEmpty = {
6262
param($ErrorTarget)
@@ -91,7 +91,7 @@
9191
}
9292

9393
@{
94-
Name = 'Stale_Since_Date'
94+
Name = 'stale_since_date'
9595
Type = 'DateTime'
9696
IfNullOrEmpty = {
9797
param($ErrorTarget)
@@ -125,7 +125,7 @@
125125
}
126126

127127
@{
128-
Name = 'Upload_Artifact'
128+
Name = 'upload_artifact'
129129
Type = 'Bool'
130130
IfNullOrEmpty = {
131131
param($ErrorTarget)
@@ -166,7 +166,7 @@
166166
}
167167

168168
@{
169-
Name = 'Export_As_Csv'
169+
Name = 'export_as_csv'
170170
Type = 'Bool'
171171
IfNullOrEmpty = {
172172
param($ErrorTarget)
@@ -206,7 +206,7 @@
206206
}
207207

208208
@{
209-
Name = 'Export_Path'
209+
Name = 'export_path'
210210
Type = 'string'
211211
IfNullOrEmpty = {
212212
param($ErrorTarget)

.github/actions/reporting/versioned-content/v1/Parameters.psd1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@{
22
Parameters = @(
33
@{
4-
Name = 'Repository'
4+
Name = 'repository'
55
Type = 'String'
66
IfNullOrEmpty = {
77
param($ErrorTarget)
@@ -31,7 +31,7 @@
3131
}
3232

3333
@{
34-
Name = 'Number'
34+
Name = 'number'
3535
Type = 'Int'
3636
IfNullOrEmpty = {
3737
param($ErrorTarget)
@@ -61,7 +61,7 @@
6161
}
6262

6363
@{
64-
Name = 'Include_Path_Pattern'
64+
Name = 'include_path_pattern'
6565
Type = 'String[]'
6666
IfNullOrEmpty = {
6767
# It's okay if this parameter is not specified.
@@ -84,7 +84,7 @@
8484
}
8585
}
8686
@{
87-
Name = 'Exclude_Path_Pattern'
87+
Name = 'exclude_path_pattern'
8888
Type = 'String[]'
8989
IfNullOrEmpty = {
9090
# It's okay if this parameter is not specified.

.github/actions/verification/authorization/v1/Parameters.psd1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@
4040
Process = {
4141
param($Parameters, $Value, $ErrorTarget)
4242

43-
[string[]]$SpecifiedAccounts = $Value -split ','
43+
[string[]]$SpecifiedAccounts = $Value -split ',' | Where-Object {
44+
-not [string]::IsNullOrEmpty($_)
45+
}
46+
4447
if ($SpecifiedAccounts.Count -gt 0) {
4548
$Parameters.AuthorizedAccounts = $SpecifiedAccounts
4649
Write-HostParameter -Name AuthorizedAccounts -Value $Parameters.AuthorizedAccounts

.github/actions/verification/checklist/v1/Parameters.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@{
22
Parameters = @(
33
@{
4-
Name = 'Body'
4+
Name = 'body'
55
Type = 'string'
66
IfNullOrEmpty = {
77
param($ErrorTarget)
@@ -30,7 +30,7 @@
3030
}
3131

3232
@{
33-
Name = 'Reference_Url'
33+
Name = 'reference_url'
3434
Type = 'string'
3535
IfNullOrEmpty = {
3636
param($ErrorTarget)

0 commit comments

Comments
 (0)