Skip to content

Make PyPI URL look nice in GH Deployments API - #10320

Merged
ThomasWaldmann merged 1 commit into
borgbackup:masterfrom
webknjaz:patch-1
Sep 3, 2026
Merged

Make PyPI URL look nice in GH Deployments API#10320
ThomasWaldmann merged 1 commit into
borgbackup:masterfrom
webknjaz:patch-1

Conversation

@webknjaz

@webknjaz webknjaz commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Description

environment.url is only the link GitHub displays for a deployment (the "View deployment"
button, the environment badge on the workflow run, the entry in the Deployments API). It does
not influence what gets uploaded or where, and it is not part of the PyPI trusted publishing
identity (that is owner/repo + workflow file + environment name).

So far every release deployment pointed at the generic project page. Appending
${{ github.ref_name }} makes each deployment link to the release it actually published, e.g.
https://pypi.org/project/borgbackup/2.0.0b24. The job only runs on tag pushes, and our tags are
bare PEP 440 versions (1.4.5, 2.0.0b24) that already match the PyPI-normalised version, so
the generated URLs resolve.

Context

I was looking into why https://pypi.org/project/borgbackup/1.4.5/#borgbackup-1.4.5.tar.gz says

Uploaded using Trusted Publishing? No

And was a bit puzzled because the CI seems to be configured just fine. Then I saw this possibility of improvement that I sometimes do in my projects and decided to make an in-browser edit. It's obviously not something I can test per your checklist (and again, it's a drive-by) but I'm the author of pypa/gh-action-pypi-publish so you can trust my knowledge here.

// Side note: I've later checked git blame and realized that the last stable release was made before you've set up TP, so your release automation is newer than that and it's probably fine. But if you need 👀/advice on your process in the future (I've seen the multibranched setup) — feel free to tag me.

Checklist

  • PR is against master (or maintenance branch if only applicable there)
  • New code has tests and docs where appropriate
  • Tests pass (run tox or the relevant test subset)
  • Commit messages are clean and reference related issues

This is just a tiny drive-by UI improvement.
@ThomasWaldmann
ThomasWaldmann merged commit f860039 into borgbackup:master Sep 3, 2026
10 of 16 checks passed
@ThomasWaldmann

Copy link
Copy Markdown
Member

@webknjaz Thanks!

@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.74%. Comparing base (9d831da) to head (202784f).
⚠️ Report is 14 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10320      +/-   ##
==========================================
- Coverage   87.70%   86.74%   -0.96%     
==========================================
  Files         103      103              
  Lines       18717    18716       -1     
  Branches     2881     2881              
==========================================
- Hits        16415    16235     -180     
- Misses       1600     1774     +174     
- Partials      702      707       +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants