[PR #5897] fix: prevent stats workflow from running on forks #11629

Closed
opened 2026-02-16 18:16:31 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/5897

State: closed
Merged: Yes


Solution

Added a condition if: github.repository == 'sst/opencode' to prevent the workflow from executing on forked repositories.

Issue

OpenCode has 3,500 Forks and this action was running on all (most) of them on a CRON.

I don't think that's the wanted behaviour. The stats workflow should only run on the main sst/opencode repository, not on forks.

This has some amusing effect, that nearly every fork is constantly committing stats to it branch.

I think it's effectively an npmjs and github DDoS attack, but POSTHOG is protected because the script checks for an API key. The more OC is forked, the higher the frequency, and even with this PR, those who forked earlier will still have this going on indefinitely.

Blacksmith

Looking at it, it shouldn't run as it uses Blacksmith and im not a customer, however it is running and AI says:

Why did it run on a GitHub-hosted runner instead?GitHub Actions has a graceful fallback behavior for unavailable custom/third-party labels:When a job specifies a label like blacksmith-4vcpu-ubuntu-2404...
...but no runner with that exact label is registered/available in the repository (which is the case on your fork, since you haven't installed the Blacksmith GitHub App)...
GitHub automatically falls back to its own hosted runners that match the base image/OS, i.e., ubuntu-24.04 (which aligns closely with ubuntu-latest at the time).
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/5897 **State:** closed **Merged:** Yes --- ## Solution Added a condition `if: github.repository == 'sst/opencode'` to prevent the workflow from executing on forked repositories. ## Issue OpenCode has 3,500 Forks and this action was running on all (most) of them on a CRON. I don't think that's the wanted behaviour. The stats workflow should only run on the main `sst/opencode` repository, not on forks. This has some amusing effect, that nearly [every fork](https://github.com/sst/opencode/forks?include=active&page=1&period=1mo&sort_by=last_updated) is constantly committing stats to it branch. I think it's effectively an `npmjs` and `github` DDoS attack, but `POSTHOG` is protected because the script checks for an API key. The more OC is forked, the higher the frequency, and even with this PR, those who forked earlier will still have this going on indefinitely. ### Blacksmith Looking at it, it shouldn't run as it uses Blacksmith and im not a customer, however it is running and AI says: ``` Why did it run on a GitHub-hosted runner instead?GitHub Actions has a graceful fallback behavior for unavailable custom/third-party labels:When a job specifies a label like blacksmith-4vcpu-ubuntu-2404... ...but no runner with that exact label is registered/available in the repository (which is the case on your fork, since you haven't installed the Blacksmith GitHub App)... GitHub automatically falls back to its own hosted runners that match the base image/OS, i.e., ubuntu-24.04 (which aligns closely with ubuntu-latest at the time). ```
yindo added the pull-request label 2026-02-16 18:16:31 -05:00
yindo closed this issue 2026-02-16 18:16:31 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11629