Skip to content

Webhook sync fails with a 403 error #1791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
monk-time opened this issue Apr 11, 2021 · 1 comment
Closed

Webhook sync fails with a 403 error #1791

monk-time opened this issue Apr 11, 2021 · 1 comment
Labels
duplicate This means already been reported. Always reference in a comment what issue or pull request number…

Comments

@monk-time
Copy link

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;
}

@Martii Martii added the duplicate This means already been reported. Always reference in a comment what issue or pull request number… label Apr 11, 2021
@Martii Martii closed this as completed Apr 11, 2021
@OpenUserJS OpenUserJS locked and limited conversation to collaborators Apr 11, 2021
@Martii
Copy link
Member

Martii commented Apr 12, 2021

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This means already been reported. Always reference in a comment what issue or pull request number…
Development

No branches or pull requests

2 participants