Skip to content

chore: notify Packagist from the release job instead of a webhook - #92

Merged
tylerjroach merged 1 commit into
masterfrom
chore/packagist-update-from-release-job
Nov 17, 2026
Merged

tylerjroach merged 1 commit into
masterfrom
chore/packagist-update-from-release-job

Conversation

@tylerjroach

Copy link
Copy Markdown
Contributor

Summary

Replace the GitHub → Packagist webhook with an explicit Packagist update at the end of the release job.

  • New "Notify Packagist" step in release-packagist.yml, after tests pass and the draft GitHub release is created. It calls Packagist's documented update-package API (packagist.org/about, "Manual hook setup") as the shared mixpanel Packagist account, using the PACKAGIST_HOOK_TOKEN secret on the release environment (Packagist's safe API token, which can only trigger package updates).
  • Fails loudly if the secret is missing or Packagist returns non-2xx, telling the releaser to use the package page's "Update" button.
  • Updated the header comment and run summary to describe the new flow.

Why

  • The existing webhook (https://packagist.org/api/github?username=jbwyme, created 2020) authenticates with a former employee's personal Packagist token, so it is likely broken or about to be. Without any hook, Packagist only crawls the package about once a week.
  • With this change, in the normal flow a version shows up on Packagist right after a release reviewer approves and PHPUnit passes, instead of seconds after the tag push. The token lives only in the gated release environment.

Not a hard gate: Packagist reads versions from git tags and still crawls weekly, so a pushed tag will eventually be indexed even if the job is never approved. The real control over what becomes a release is the tag ruleset (only sdk-maintainers can push [0-9]* tags).

After merge

  • Delete the old Packagist webhook (?username=jbwyme) under Settings → Webhooks.

Test plan

  • Workflow YAML parses; step order: draft release → Notify Packagist → Summary.
  • Failure path checked against the live endpoint with made-up credentials: HTTP 403 Missing or invalid username/apiToken → the step fails as intended.
  • Next PHP release: confirm the step returns 2xx and the version appears on https://packagist.org/packages/mixpanel/mixpanel-php.

🤖 Generated with Claude Code

Call Packagist's update-package API as the shared 'mixpanel' account at
the end of release-packagist.yml, after approval and tests, using the
PACKAGIST_HOOK_TOKEN secret on the release environment. Replaces the
GitHub webhook that authenticated with a former employee's token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tylerjroach
tylerjroach requested review from a team and jakewski November 17, 2026 18:29
@greptile-apps

greptile-apps Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This change appears safe to merge; no actionable issues were found.

Reviews (1) · Last reviewed commit: "chore: notify Packagist from the release..." · Reviewed by Greptile

@rahul-mixpanel rahul-mixpanel left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I checked that mixpanel is the only maintainer of mixpanel/mixpanel-php on Packagist and that the URL Packagist has registered matches REPO_URL exactly, so the call should succeed once PACKAGIST_HOOK_TOKEN is set on the release environment. Two optional nits inline.

Comment thread .github/workflows/release-packagist.yml Resolved
Comment thread .github/workflows/release-packagist.yml Resolved
@tylerjroach
tylerjroach removed the request for review from jakewski November 17, 2026 18:59
@tylerjroach
tylerjroach merged commit 7e440b9 into master Nov 17, 2026
2 checks passed
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