Skip to content

chore(ci): rename release.yml → publish.yml to match PyPI Trusted Publisher#638

Merged
MartinCastroAlvarez merged 1 commit into
mainfrom
chore/rename-release-to-publish-workflow
May 31, 2026
Merged

chore(ci): rename release.yml → publish.yml to match PyPI Trusted Publisher#638
MartinCastroAlvarez merged 1 commit into
mainfrom
chore/rename-release-to-publish-workflow

Conversation

@MartinCastroAlvarez
Copy link
Copy Markdown
Owner

You just configured the PyPI Trusted Publisher for django-admin-react with workflow filename publish.yml. The repo currently has the workflow as release.yml, so PyPI's OIDC trust would reject the token (PyPI keys trust on the filename verbatim).

Aligning the file with PyPI's config + publish.yml is the clearer name anyway — the workflow IS about publishing to PyPI, not about the GitHub Release as an artefact.

Changes

  • git mv .github/workflows/release.yml .github/workflows/publish.yml
  • name: field at the top of the workflow: releasepublish (so the Actions UI label matches the filename).
  • In-file one-time-setup comment now reads Workflow: publish.yml.
  • .github/workflows/README.md reference updated.
  • SECURITY.md §7 reference updated.
  • ci.yml's pin-rationale comment updated.

No behaviour change. SHA-pinned actions, idempotency guard, OIDC permissions, testpypi/pypi dispatch options all unchanged.

After this merges

Next release (1.4.12 or whatever) is the smoke test:

  1. Bump pyproject.
  2. Commit + PR + merge to main.
  3. Tag + gh release create → fires release: published → the workflow runs OIDC publish via the configured trust.

The local .env POETRY_PYPI_TOKEN_PYPI path is no longer the default; it stays only as a manual fallback.

🤖 Generated with Claude Code

…lisher

PyPI's Trusted Publisher config keys trust on the workflow filename.
The repo had the workflow as `release.yml`, but the owner just
configured the PyPI trusted publisher with the canonical
`publish.yml` name (clearer — the workflow IS about publishing to
PyPI, not about "the release"). Aligning the file with PyPI's config
so OIDC uploads succeed; otherwise PyPI rejects the OIDC token from a
workflow whose filename doesn't match the trust.

Refresh:
- `name:` field `release` → `publish` so the GitHub Actions UI label
  matches the file.
- In-file one-time-setup comment now says `Workflow: publish.yml`.
- `.github/workflows/README.md` and `SECURITY.md` references updated.
- `ci.yml`'s pin-rationale comment now lists `publish.yml` instead of
  `release.yml`.

No behaviour change beyond the trust-name alignment; the workflow's
SHA-pinned actions, idempotency guard, OIDC permissions and
testpypi/pypi dispatch options are unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@MartinCastroAlvarez MartinCastroAlvarez merged commit f48d798 into main May 31, 2026
5 checks passed
@MartinCastroAlvarez MartinCastroAlvarez deleted the chore/rename-release-to-publish-workflow branch May 31, 2026 10:06
MartinCastroAlvarez added a commit that referenced this pull request May 31, 2026
….4.13 (#643)

A ModelAdmin action that returns ``HttpResponseRedirect(some_url)``
was looking silently no-op'd to the operator: the click ran, the
toast didn't appear, and nothing visible happened. The diagnosis in
the issue blamed the API for swallowing the response, but the API
correctly extracts ``response["Location"]`` into the JSON envelope's
``redirect`` field (``api/views/actions.py:256``). The actual bug was
on the SPA: ``DetailPage`` piped the redirect URL straight into
React Router's ``navigate`` — which is scoped to the SPA's
``BrowserRouter`` ``basename``, so any URL outside the SPA mount
silently no-op'd:

  - legacy admin paths (``/admin/<app>/<model>/<pk>/change/``)
  - hijack / impersonate URLs (``/hijack/release-user/?next=…``)
  - cross-origin downloads (signed S3 URLs)

New ``followActionRedirect`` helper (`apps/web/src/action-redirect.ts`)
picks the right primitive per URL: ``navigate`` for same-origin paths
inside the SPA mount (no full reload), ``window.location.assign``
for everything else. Returns a stripped basename-relative path to
the navigate call so BrowserRouter doesn't double-prefix.

The helper is dependency-injected (``currentOrigin``,
``assignLocation``) so the test suite can lock the routing logic
without touching jsdom's non-configurable ``window.location``.

Locks: 6 new vitests in `action-redirect.test.ts` cover the SPA-
internal path, search + hash preservation, the legacy-admin path,
cross-origin URLs, the hijack pattern, and a malformed-URL fallback.

Release 1.4.13 bundles this with the unreleased changes since
1.4.12 (all already merged on main):

  - #631 / PR #641 — ``PRIMARY_COLOR`` reads ``site_primary_color``
    off the configured ``AdminSite`` before falling back to the
    setting + default.
  - #626 / PR #642 — ``raw_id_fields`` and ``radio_fields`` now
    render their intended widgets (plain-pk text input + lookup
    link, inline radio bank) instead of falling through to
    autocomplete / ``<select>``.
  - #623 / #624 / #633 / #634 / #635 — README "Stock-Django hooks
    that do NOT carry through" / "Writing safe ``list_display``
    callables" / "Hardening" / "Mounting the API on a different
    origin" sections (PR #640).
  - PR #638 — ``release.yml`` → ``publish.yml`` rename so PyPI's
    Trusted Publisher config matches the workflow filename.

Closes #620.

Co-authored-by: Martin Castro Laminrs <mcastro@laminr.ai>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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