Skip to content
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

feat: add /api/sponsors_goal endpoint #3690

Merged
merged 2 commits into from
Dec 8, 2024
Merged

Conversation

davidmhewitt
Copy link
Member

Adds an API endpoint to return the current GitHub sponsors goal and the percentage towards it. Example response:

{"percent":23,"target":7500}

Means we can keep the GitHub token in config on the server and not expose it in a compiled package on the system.

@alainm23
Copy link
Contributor

alainm23 commented Dec 7, 2024

Great, is there anything else missing to approve this PR? Honestly, I don’t know PHP, and I’ve always refused to learn it 😅️.

@davidmhewitt
Copy link
Member Author

This should be ready to go, I've tested locally and confirmed it's working. I don't know if someone like @lewisgoddard wants to review the code.

Ideally we would have some caching here as this data won't change so often so we don't need to call the GitHub API every time, maybe just every hour or so. But I can configure some caching in cloudflare to cache the responses if necessary.

@lewisgoddard lewisgoddard enabled auto-merge (squash) December 8, 2024 15:36
@lewisgoddard lewisgoddard merged commit 253b430 into master Dec 8, 2024
5 checks passed
@lewisgoddard lewisgoddard deleted the sponsor_goal_api branch December 8, 2024 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants