Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
brianmay opened this issue Mar 2, 2025 · 1 comment · Fixed by #17699
Closed

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

brianmay opened this issue Mar 2, 2025 · 1 comment · Fixed by #17699
Labels

Comments

@brianmay
Copy link

brianmay commented Mar 2, 2025

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

@brianmay brianmay added bug 🐛 requires triaging maintainers need to do initial inspection of issue labels Mar 2, 2025
@di di removed the requires triaging maintainers need to do initial inspection of issue label Mar 3, 2025
@di
Copy link
Member

di commented Mar 3, 2025

Thanks for the issue, I looked at the activity for your project and as best as I can tell, the leading whitespace is the culprit.

With some trial and error, I've determined that GitHub environment names must have the following properties:

  • maximum of 255 characters
  • must not contain non-printable characters or the characters ', ", `, ,, ;, \
  • leading and trailing whitespace is stripped
  • repeated whitespace is not consolidated
  • case-insensitive

...none of which we are currently validating for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants