** Automating Clash Premium Rules with GitHub Actions
If you use Clash Premium (the open-source proxy tool), you know rule sets are the backbone of your config. Manually updating them is a pain and easy to forget. This project takes that chore off your plate by automatically generating fresh rule sets every day.
What It Does
The repo (Loyalsoldier/clash-rules) provides pre-built, categorized rule sets for Clash Premium. Think of it as a ready-to-use library of rules for common services (like Apple, Google, streaming platforms, and ad domains). These aren’t static files either — a GitHub Actions workflow runs daily, pulling the latest domain lists and regenerating the rules.
Why It’s Cool
The clever part is the automation. Instead of you manually cloning or scraping sources, the workflow runs on a cron schedule. It fetches data from well-known sources (like v2fly domain list, adblock lists, and custom GitHub gists), processes them into the .yaml and .mrs formats Clash prefers, and pushes updates back to the repo. No manual intervention, no drift. This is especially useful if you’re running Clash on a router or a server and want “set it and forget it” reliability.
How to Try It
You don’t need to clone the whole repo. Just grab the URL for a specific rule set you need. For example, for Apple services:
https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/apple.txt
Or the packed .mrs format:
https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/apple.mrs
Then drop that URL into your Clash config under the rule-providers section. The rules update whenever Clash refreshes its providers (you can set the interval).
If you want to customize the sources or add your own rules, fork the repo and let your own GitHub Actions handle the daily build.
Final Thoughts
This is a solid practical project. It automates something tedious and keeps your proxy configuration current without extra overhead. If you’re already running Clash Premium, this is a no-brainer addition. For devs who like to inspect the pipeline, the workflow file is clean and well-documented — worth a read even if you don’t use Clash.
Found this on GitHub? We share hidden gems like this daily. Follow us @githubprojects.