Skip to content

white space error in environment name causes invalid-publisher error #17689

@brianmay

Description

@brianmay

Describe the bug
Initial report: pypa/gh-action-pypi-publish#349

I kept getting invalid-publisher when trying to publish my python code, yet all the values looked like they were correct.

I strongly suspect when I copied and pasted the environment name, it had a leading white space, which was not at all obvious, and the general cause of the error.

I deleted the publisher and recreated it and the problem disappeared.

Expected behavior
White space should not be allowed when entering the environment name. Or it leading/trailing white space should be stripped automatically.

If there is whitespace in the name, it should be made obvious when looking at the entry that this is the problem.

I am not absolutely sure if I got a space character or some other white space character (e.g. non breaking space). Suspect any white space character probably would cause this issue.

To Reproduce

  1. Create new publisher.
  2. Ensure environment name has leading whitespace.
  3. Attempt to publish package in CI.

My Platform

Firefox 135.0.1

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions