Skip to content

Automatically update modrinth description from a file in the repository

License

Notifications You must be signed in to change notification settings

funnyboy-roks/modrinth-auto-desc

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Modrinth Auto-Description

Automatically update the description for a Modrinth project from a markdown file in the repo.

Links

In order to have images and links, you must use absolute urls, meaning don't use img.png, use https://example.com/img.png.

For GitHub paths, you can use https://raw.githubusercontent.com/<username>/<repo>/<branch>/<path>.

Front Matter

If your readme contains front matter (either yaml or json), you can send additional data to the Modrinth API.

All additional data can be found in the Modrinth Docs.
Note: The body key should not be specified and will be ignored if it is.

Front Matter Format:

JSON:

---
{
    "modrinth": {
        "source_url": "https://github.com/funnyboy-roks/mapify"
    }
}
---
# Your content here...

YAML:

---
modrinth:
    source_url: 'https://github.com/funnyboy-roks/mapify'
---
# Your content here...

Inputs

auth-token

Required

The auth token to use for the Modrinth API

To get this, you need to:

  1. Go to https://modrinth.com/settings/pats and sign in if you aren't already
  2. Click "Create a PAT" in the top-left corner
  3. Name it something that describes its purpose, i.e. "GitHub actions" or "Auto Description"
  4. Under scopes, find "Write Projects" and make sure it's checked
  5. Give it an expiration date -- Once this expiration date is reached, you'll need to generate a new token.
    1. This is to ensure security. Anybody with this token could do harm to your project(s).
  6. Press "Create PAT"
  7. The PAT you just created should appear with some random numbers and letters, copy that
  8. Put it in a GitHub Secret
  9. You're done!

slug

Required

This is the URL, slug, or id of the Modrinth project.

readme

Optional, default = README.md

The path to the readme to fetch from the root of the GitHub repo.

Example Usage

on:
  push:
    branches: [ main ]
jobs:
  modrinth-desc:
    runs-on: 'ubuntu-latest'
    steps:
    - uses: actions/checkout@v3
    - uses: funnyboy-roks/modrinth-auto-desc@v1.5
      with:
        auth-token: ${{ secrets.MODRINTH_AUTH_TOKEN }}
        slug: 'mapify'