Skip to content

Conversation

michaeltlombardi
Copy link
Contributor

PR Summary

Prior to this change, the verification/authorization GitHub Action only supported checking the assigned permissions for a user. This worked for normal accounts. However, the managed bot account for the Learn platform doesn't have permissions for this repository.

This change adds a new (backwards-compatible) authorized_accounts parameter to the GHA. Repository maintainers can now define an allowlist to use for authorization in addition to the permissions to check. If a user is explicitly in the allowlist, the action skips checking their permissions. If a user isn't in the allowlist, they can still pass authorization if they have matching permissions.

PR Checklist

  • Descriptive Title: This PR's title is a synopsis of the changes it proposes.
  • Summary: This PR's summary describes the scope and intent of the change.
  • Contributor's Guide: I have read the contributor's guide.
  • Style: This PR adheres to the style guide.

Prior to this change, the verification/`authorization` GitHub Action
only supported checking the assigned permissions for a user. This
worked for normal accounts. However, the managed bot account for the
Learn platform doesn't have permissions for this repository.

This change adds a new (backwards-compatible) `authorized_accounts`
parameter to the GHA. Repository maintainers can now define an
allowlist to use for authorization in addition to the permissions
to check. If a user is explicitly in the allowlist, the action skips
checking their permissions. If a user isn't in the allowlist, they
can still pass authorization if they have matching permissions.
Copy link
Contributor

Learn Build status updates of commit 88f7c5c:

✅ Validation status: passed

File Status Preview URL Details
.github/actions/.pwsh/scripts/Test-Authorization.ps1 ✅Succeeded
.github/actions/verification/authorization/v1/action.yml ✅Succeeded
.github/actions/verification/authorization/v1/Parameters.psd1 ✅Succeeded
.github/actions/verification/authorization/v1/readme.md ✅Succeeded
.github/workflows/targeting-valid-branch.yml ✅Succeeded

For more details, please refer to the build report.

@sdwheeler sdwheeler merged commit 9893b7c into MicrosoftDocs:main Jun 26, 2025
4 checks passed
michaeltlombardi added a commit to michaeltlombardi/PowerShellDocs that referenced this pull request Jul 31, 2025
Prior to this change, the authorization workflow used the PowerShell
script parameter names and casing for the action parameter names.
This worked for all previous parameters because PowerShell is case
insensitive and the parameters were only one word.

However, in MicrosoftDocs#12181, we added the `authorized_accounts` parameter
to the workflow. For GitHub Actions, we use `snake_case` for
parameter names, where PowerShell best practice is to use
`PascalCase`.

PowerShell's case insensitivity meant that we were able to handle
the prior parameters, which the workflow sends to the handler
scripts as the `INPUT_<ParameterName>` environment variables.

When we added `authorized_accounts`, the handler scripts were
looking for `INPUT_AuthorizedAccounts`, which doesn't exist.

This change updates the `Name` key for every defined parameter in
the `verification/authorization/v1` workflow to match the actual
workflow parameter name and casing.
michaeltlombardi added a commit to michaeltlombardi/PowerShellDocs that referenced this pull request Jul 31, 2025
Prior to this change, the authorization workflow used the PowerShell
script parameter names and casing for the action parameter names.
This worked for all previous parameters because PowerShell is case
insensitive and the parameters were only one word.

However, in MicrosoftDocs#12181, we added the `authorized_accounts` parameter
to the workflow. For GitHub Actions, we use `snake_case` for
parameter names, where PowerShell best practice is to use
`PascalCase`.

PowerShell's case insensitivity meant that we were able to handle
the prior parameters, which the workflow sends to the handler
scripts as the `INPUT_<ParameterName>` environment variables.

When we added `authorized_accounts`, the handler scripts were
looking for `INPUT_AuthorizedAccounts`, which doesn't exist.

This change updates the `Name` key for every defined parameter in
the `verification/authorization/v1` workflow to match the actual
workflow parameter name and casing.
sdwheeler pushed a commit that referenced this pull request Jul 31, 2025
Prior to this change, the authorization workflow used the PowerShell
script parameter names and casing for the action parameter names.
This worked for all previous parameters because PowerShell is case
insensitive and the parameters were only one word.

However, in #12181, we added the `authorized_accounts` parameter
to the workflow. For GitHub Actions, we use `snake_case` for
parameter names, where PowerShell best practice is to use
`PascalCase`.

PowerShell's case insensitivity meant that we were able to handle
the prior parameters, which the workflow sends to the handler
scripts as the `INPUT_<ParameterName>` environment variables.

When we added `authorized_accounts`, the handler scripts were
looking for `INPUT_AuthorizedAccounts`, which doesn't exist.

This change updates the `Name` key for every defined parameter in
the `verification/authorization/v1` workflow to match the actual
workflow parameter name and casing.
@michaeltlombardi michaeltlombardi deleted the maint/main/update-auth-action branch July 31, 2025 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants