Skip to content

Webhook sync fails with a 403 error  #1791

Description

@monk-time

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis means already been reported. Always reference in a comment what issue or pull request number…

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions