Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
theogiraudet committed Jan 22, 2025
0 parents commit 44bd216
Show file tree
Hide file tree
Showing 10 changed files with 72,733 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'Modrinth Modpack Update Checker Test'

on:
schedule:
- cron: '0 * * * *' # Every hour
workflow_dispatch: # Allow running the workflow manually

jobs:
check-updates:
runs-on: ubuntu-latest
steps:
- name: 'Check Modrinth Modpack updates'
uses: Gunivers/modrinth-modpack-update-checker@v1
id: check
with:
modrinth-modpack-slug: 'map-making-modpack'

- name: Print if the modpack can be upgraded
if: ${{ steps.check.outputs.can-upgrade == 'true' }}
run: "echo \"The modpack can be upgraded to the new Minecraft version\""
- name: Print if the modpack cannot be upgraded
if: ${{ steps.check.outputs.can-upgrade == 'false' }}
run: "echo \"The modpack cannot be upgraded to the new Minecraft version\""
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.cache/

# Node.js
node_modules/

# Misc
.DS_Store
Thumbs.db
373 changes: 373 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Modrinth's Modpack Update Checker

A GitHub action that checks if a modpack can be upgraded to a new Minecraft version.

## Usage

```yaml
name: 'Modrinth Modpack Update Checker'

on:
schedule:
- cron: '*/60 * * * *' # Every hours
workflow_dispatch: # Allow running the workflow manually

jobs:
check-updates:
runs-on: ubuntu-latest
steps:
- name: 'Check Modrinth Modpack updates'
uses: Gunivers/modrinth-modpack-update-checker@v1
id: check
with:
modrinth-modpack-slug: 'example-modpack'

- name: Print if the modpack can be upgraded
if: ${{ steps.check.outputs.can-upgrade == 'true' }}
run: "echo \"The modpack can be upgraded to the new Minecraft version\""
```
## Inputs
| Input | Description | Required | Default |
|-------|-------------|----------|---------|
| `modrinth-modpack-slug` | The slug of the modpack to check | true | |
| `modrinth-project-getter-url` | The API endpoint to get project information | false | `https://api.modrinth.com/v2/project/{}` |
| `modrinth-versions-getter-url` | The API endpoint to get versions of a modpack | false | `https://api.modrinth.com/v2/project/{}/version` |
| `modrinth-version-getter-url` | The API endpoint to get version information | false | `https://api.modrinth.com/v2/version/{}` |
| `skipped-versions` | Array of Minecraft version to skip in tests, separated by commas, example: `1.21.1, 1.21.2` | false | |

## Outputs

<!-- A table of outputs with their description -->

| Output | Description |
|--------|-------------|
| `current-version` | The current version of the modpack |
| `searched-version` | The version of Minecraft that was checked |
| `supported` | The mods that are supported on the searched version, separated by commas |
| `unsupported` | The mods that are not supported on the searched version, separated by commas |
| `can-upgrade` | Whether the modpack can be upgraded to the searched version |

36 changes: 36 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: 'Modrinth Modpack Update Checker'
description: 'Checks if all the mods of a Modrinth Modpack are available on the newest Minecraft versions'
inputs:
modrinth-modpack-slug:
description: 'The Modrinth slug of the modpack to watch'
required: true
modrinth-project-getter-url:
description: 'The API endpoint to get project information'
required: false
default: "https://api.modrinth.com/v2/project/{}"
modrinth-versions-getter-url:
description: 'The API endpoint to get versions of a modpack'
required: false
default: "https://api.modrinth.com/v2/project/{}/version"
modrinth-version-getter-url:
description: 'The API endpoint to get version information'
required: false
default: "https://api.modrinth.com/v2/version/{}"
skipped-versions:
description: 'Array of Minecraft version to skip in tests'
required: false
default: ""
outputs:
current-version:
description: 'The current version of the modpack'
searched-version:
description: 'The version of Minecraft that was checked'
supported:
description: 'The mods that are supported on the searched version'
unsupported:
description: 'The mods that are not supported on the searched version'
can-upgrade:
description: 'Whether the modpack can be upgraded to the searched version'
runs:
using: 'node20'
main: 'dist/main.js'
Loading

0 comments on commit 44bd216

Please sign in to comment.