fix(release): mirror built userscripts at repo root for GreasyFork sync - #38
Merged
Merged
Conversation
GreasyFork's "release published" webhook only recognizes a sync URL of the form .../releases/latest/download/<pkg>.user.js by resolving it to a repo-root-relative git path of exactly <pkg>.user.js at the release's tag - it does not preserve the packages/<pkg>/dist/ nesting. The dist commit now also mirrors each built script at repo root under that flat name so `git show <tag>:<pkg>.user.js` actually finds it. Also removes scripts/setup-greasyfork-webhook.js, which posted to a GreasyFork endpoint/contract that doesn't exist (webhook setup is manual via the GreasyFork UI - there is no such automation API).
Userscript Version PreviewPreview only — versions and CHANGELOGs are bumped automatically on merge to
|
nsheaps
marked this pull request as ready for review
August 6, 2026 03:05
…c fix Manual patch bump on each greasyforkPublish package so merging this PR cuts a real release - the root-mirror fix itself doesn't touch package source, so without this the auto-bump pipeline would see no package changes and skip building/tagging/releasing, leaving the fix unverified end-to-end.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Investigated GreasyFork's actual sync-via-webhook implementation (source:
lib/github.rb,app/controllers/concerns/webhooks.rb) to figure out why async_identifierpointed at this repo wouldn't actually sync. Findings:https://github.com/<owner>/<repo>/releases/latest/download/<file>— which is exactly what each package's@downloadURL/@updateURLalready uses.releases/.../download/prefix and treating whatever's left as the entire repo-relative path (seeGithub.file_from_root_for_url), then runsgit show <release-tag>:<that-path>.<pkg>.user.js), notpackages/<pkg>/dist/script.user.js. Our dist-commit only ever contained the nested path, so the webhook'sgit showwould have 404'd on every sync attempt.dist/files out ofmain's history (tag-only).Changes
.github/workflows/release.yaml: the "Commit built userscripts for GreasyFork sync" step now also mirrors each package's built file at the repo root under the flat name matching its release asset (<pkg>.user.js), in addition to the existing nestedpackages/<pkg>/dist/script.user.jscopy. Same dist-commit, same tags (release tag + floatinglatest).scripts/setup-greasyfork-webhook.js— dead code that POSTed arepository_url/webhook_secretJSON body to/en/users/webhook-info, an endpoint/contract that doesn't exist. GreasyFork's webhook setup is a manual one-time step in its own UI; there is no such automation API.Test plan
git show <release-tag>:<file>with<file>derived as a flat, root-relative name for thereleases/latest/download/URL form.<pkg-dir-name>.user.js) matches exactly what the existing "Upload userscripts as release assets" step already uploads and what each package's@downloadURL/@updateURLalready points at.github-actions-grafana-jump.user.js,github-to-graphite-button.user.js, andgraphite-to-github-button.user.jsat the new release tag (git show <tag>:<pkg>.user.js).Generated by Claude Code