Skip to content

Use PSGALLERY_API_KEY for PowerShell Gallery publishing #343

Description

Module maintainers need one self-describing PowerShell Gallery publishing credential across the reusable workflow, publishing action, configuration, and documentation. A single name makes the credential easy to audit and prevents mismatched caller and action contracts.

Request

Desired experience

Publishing a module requires PSGALLERY_API_KEY at every workflow and action boundary. A caller provides that one credential, and the reusable workflow forwards it unchanged to the publishing action.

Acceptance criteria

  • The reusable workflow declares and consumes PSGALLERY_API_KEY
  • The Publish-Module reusable workflow and Publish-PSModule action input use PSGALLERY_API_KEY
  • The publishing action's environment variable and PowerShell variable identify the PowerShell Gallery credential consistently
  • Canonical caller templates and Process-PSModule documentation require PSGALLERY_API_KEY
  • Publishing to the PowerShell Gallery continues to use the supplied credential

Technical decisions

Credential contract: Use PSGALLERY_API_KEY for the workflow secret, publishing action input, and action environment variable. This name is explicit about both its service and purpose.

PowerShell command interface: The underlying Publish-PSResource cmdlet keeps its -ApiKey parameter because that is the cmdlet's public PowerShell interface. The value passed to it is held in the action's $psGalleryApiKey variable.

Workflow scope: Publish-Module forwards PSGALLERY_API_KEY directly to Publish-PSModule. No translation is needed at any GitHub Actions boundary.

Documentation: Setup, caller, workflow-reference, design, and action documentation name only PSGALLERY_API_KEY as the required publishing credential.


Implementation plan

Credential contract

  • Declare and forward PSGALLERY_API_KEY in the root reusable workflow and Publish-Module workflow
  • Rename the Publish-PSModule action input and environment variable to PSGALLERY_API_KEY
  • Update the publishing script to use $psGalleryApiKey

Documentation and validation

  • Update canonical caller templates and Process-PSModule documentation
  • Run workflow self-tests and action unit tests
  • Confirm a real consumer publish to the PowerShell Gallery succeeds with PSGALLERY_API_KEY

Implementation is delivered by PR #408.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    MajordocumentationImprovements or additions to documentationgithub_actionsPull requests that update GitHub Actions code

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions