Discussioni » Feedback di Greasy Fork
Why is my webhook update not working?
You have not well coded in your github workflow. https://github.com/Sukwants/Ex124OJ
The metadata.js
is not the production js file.
You need to config your github workflow such that it can trigger the "modified file" in your github files.
You current coding can just make production file in https://github.com/Sukwants/Ex124OJ/releases but Greasy Fork would not detect the things in releases
- Place your placeholder js file in github. it can be branch of your main branch.
- So you can have a link (raw file link) and you can set it in the auto-sync.
- You need to add an action to workflow file such that it can have the github bot to modify your placeholer js.
- Your update shall trigger that action such that the bot will modify the file to the actual output.
- Webhook (Modification Event) will be sent to Greasy Fork for that placeholder js file
Just checked again your workflow scripts. Ignore the above two comments.
Your current approach is to generate a production file to put inside the /dist
But this would not trigger the "modification event"
You need to place a placeholder js file in /dist
( in main
branch)
so your bot will override it instead of create a new file.
Of course, your auto sync script is also the raw link of the placeholder file. ( in build
branch)
https://github.com/Sukwants/Ex124OJ/raw/build/dist/ex124oj.user.js
You can check the webhook history record in Webhooks / Manage webhook. (Recent Deliveries)
Your dist/ex124oj.user.js
should appear inside "modified", NOT "added"
Oh, thanks for your help.
As you said, my 'dist/ex124oj.user.js' appeared in "added" instead of "modified".
Now I've modified my workflow to create an empty placeholder file in the build branch and create a commit, then generate the production file and create another commit, and then push it to GitHub.
Now my workflow and webhook update is working well.
Thanks again for your help.
I've set up webhooks on GitHub's repository and auto-sync links on Greasy Fork's script page.
Recent Deliveries has a response code of
200
, but the reply message saysNo commits found in this push.
.But the request does have a commit record in it.
My approach is to use GitHub Actions to execute
npm run build
and force push to the build branch, is that problematic?