opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix: prevent stats workflow from running on forks

Open ahosker opened this issue 1 month ago • 0 comments

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).

ahosker avatar Dec 21 '25 11:12 ahosker