Skip to content
file-plus

GitHub Action

Discord Class Updater

v1-rc Pre-release

Discord Class Updater

file-plus

Discord Class Updater

automatically update discord class names

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Discord Class Updater

uses: Metro420yt/class-update@v1-rc

Learn more about this action in Metro420yt/class-update

Choose a version

Inputs

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'

Outputs

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

Examples

🔗 this is a workflow i use for a fork

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.com blueprint

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>"}

Credits