Add a step like this to your workflow:
- uses: metro420yt/class-update@v1-rc
with:
# folder that has your theme files
# Default: themes
folder: 'src'
# file extension to target
# Default: css
ext: scss
# url or relative path to a file containing an old&new pair of class names
# Default: https://raw.githubusercontent.com/SyndiShanX/Update-Classes/main/Changes.txt
diff: './changes.txt'
The action provides these outputs:
totalChanges
: the total number of classes that were replaced
For more info on how to use outputs, see "Context and expression syntax".
When SyndiShanX's Changes.txt updates
When SyndiShanX's Changes.txt updates
name: Update Classes
on:
workflow_dispatch: # manually trigger
repository_dispatch: # trigger by webhook (example below)
types: [update_class] # id for webhook to target
jobs:
classUpdate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: update
uses: metro420yt/class-update@v1-rc
with:
folder: stuff
ext: scss
- uses: gha-utilities/[email protected] #compile scss files
if: ${{steps.update.outputs.totalChanges > 0}} #skip if no class changes
with:
source: ./app.scss
destination: ./betterdiscord/main.css
outputStyle: expanded
- uses: EndBug/add-and-commit@v9
if: ${{steps.update.outputs.totalChanges > 0}} #skip if no class changes
with:
default_author: github_actions
message: "chore: update classes"
fetch: true
im using make.com since they have a free tier, but this can be without them if needed
make sure to set up a schedule, i wouldnt try and make it run more than once per hour to stay under the 1000 operations/month
- using an rss feed parser, have it check this feed for new items (commits)
- when a new commit is made, send a POST request to
https://api.github.com/repos/<YOUR_REPO>/dispatches
with this info (docs)- headers:
- Accept: application/vnd.github+json (might not need, idk)
- Content-Type: application/json
- Authorization:
Bearer <YOUR_TOKEN>
(see here)
- body:
{"event_type": "<YOUR_DISPATCH_ID>"}
- headers:
- inspired by ClassUpdate from Saltssaumure
- changelist maintained by SyndiShanX (repo)
- class name history maintained by itmesarah (repo)
- README.md based on EndBug/add-and-commit