OpenUserJS / OpenUserJS.org

The home of FOSS user scripts.

Home Page:https://openuserjs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Webhook sync fails with a 403 error

monk-time opened this issue · comments

I have configured a GitHub webhook in my repo that contains multiple userscripts to that the site can auto-update three of them that I have uploaded there. The ping event was delivered successfully but the actual push fails with a 403 error:

image

I highly suspect this is caused by me having main as my default branch name. I have found another issue here about the same problem (#1781), but it's locked because of what seems like a major misunderstanding.

Regardless of the maintainers' position re: the name of OpenUserJS.org default branch, it would be great if sync could be fixed to work with repos that have main as their default branch name. AFAICT that would require adding payload.ref !== 'refs/heads/master' && payload.ref !== 'refs/heads/main' here:

// Only accept commits from the `master` branch
if (payload.ref !== 'refs/heads/master') {
aRes.status(403).send(); // Forbidden
return;
}

Apparently this needs to be clarified thrice... duplicate of #1781.

Also read labels and milestones. It is almost never as easy as a one liner... so don't be naive please. The other issue is open and will be addressed in due time. Do not open duplicate issues or tack on to a closed issue... this policy will be enforced completely in the next few days.