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

Add nudge message with magic link to create new Trusted Publisher #250

Merged
merged 5 commits into from
Sep 5, 2024

Conversation

facutuesca
Copy link
Contributor

@facutuesca facutuesca commented Aug 6, 2024

This adds a nudge message for the user with a link to create a Trusted Publisher for the project being uploaded. The link is a "magic link", containing URL parameters that will pre-fill most of the Trusted Publisher form fields.

This was originally discussed in pypi/warehouse#13661, and currently under review in pypi/warehouse#16399.

The nudge message will only be displayed when not using Trusted Publishing, and if the index is either PyPI or TestPyPI. It looks like this:

Warning:  A new Trusted Publisher for the currently running publishing workflow can be created by accessing the following link(s) while logged-in as a maintainer of the package(s):
- https://test.pypi.org/manage/project/my-project/settings/publishing/?provider=github&owner=my_username&repository=my_project&workflow_filename=release.yml

The message is also added to the job's summary, where it's rendered as Markdown and the links are clickable.

A small Python utility script was added in order to parse the package name(s) from the distribution files.

This is ready for review, but it's a draft PR since it shouldn't be merged until PyPI's side is merged: pypi/warehouse#16399

cc @woodruffw @webknjaz

print-pkg-name.py Outdated Show resolved Hide resolved
twine-upload.sh Outdated Show resolved Hide resolved
@facutuesca facutuesca force-pushed the pypi-tp-magic-link branch 7 times, most recently from dd37137 to baea148 Compare August 7, 2024 16:57
@facutuesca facutuesca marked this pull request as ready for review August 13, 2024 08:12
@facutuesca facutuesca marked this pull request as draft August 13, 2024 08:15
@facutuesca facutuesca marked this pull request as ready for review August 19, 2024 16:46
@webknjaz webknjaz added the enhancement New feature or request label Sep 1, 2024
twine-upload.sh Outdated Show resolved Hide resolved
requirements/runtime.txt Outdated Show resolved Hide resolved
print-pkg-names.py Outdated Show resolved Hide resolved
twine-upload.sh Outdated Show resolved Hide resolved
@facutuesca facutuesca force-pushed the pypi-tp-magic-link branch 2 times, most recently from 910d9d8 to 61b9b74 Compare September 3, 2024 14:32
print-pkg-names.py Outdated Show resolved Hide resolved
facutuesca and others added 2 commits September 4, 2024 15:50
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
@webknjaz
Copy link
Member

webknjaz commented Sep 5, 2024

@facutuesca are you planning to polish the commits or do you want me to squash?

@facutuesca
Copy link
Contributor Author

@facutuesca are you planning to polish the commits or do you want me to squash?

Go ahead and squash

@webknjaz webknjaz merged commit 3697819 into pypa:unstable/v1 Sep 5, 2024
2 checks passed
@woodruffw woodruffw deleted the pypi-tp-magic-link branch September 5, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants