Skip to content

[Security] publish.yml workflow allows manual dispatch without environment protection #39

Description

@cocallaw

Summary

The publish.yml workflow has a workflow_dispatch trigger with no GitHub Environment gate or approval requirement. Anyone with write access can manually trigger a publish to PowerShell Gallery at any time, bypassing the tag-based release flow.

Impact

Accidental or unauthorized module publication to PSGallery.

Location

  • .github/workflows/publish.ymlworkflow_dispatch trigger

Suggested fix

Add a GitHub Environment (e.g., production) with required reviewers to the publish job:

jobs:
  publish:
    runs-on: ubuntu-latest
    environment: production   # Requires approval before running
    steps:
      # ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    ciCI/CD pipeline changespriority: mediumMedium priority — plan for near-termsecuritySecurity vulnerability or hardening

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions