Skip to content

Update

Update #297

Workflow file for this run

name: Update
on:
schedule:
- cron: "0 6 * * *" # every saturday at 6am
workflow_dispatch:
inputs:
ignore_update_check:
description: "Ignore update check?"
required: true
default: true
type: boolean
override_version:
description: "Override version to check"
required: false
default: ""
type: string
jobs:
check_for_updates:
runs-on: ubuntu-latest
outputs:
id: ${{ steps.check.outputs.id }}
steps:
- id: check
name: Check for Minecraft Updates
uses: ByMartrixX/minecraft-update-check-action@v0
with:
version-manifest-url: 'https://piston-meta.mojang.com/mc/game/version_manifest_v2.json'
cache-base-key: 'mc-manifest-'
update:
runs-on: ubuntu-latest
needs: check_for_updates
if: ${{ needs.check_for_updates.outputs.id != '' || github.event.inputs.ignore_update_check == 'true' }}
outputs:
additions: ${{ steps.generator.outputs.additions }}
deletions: ${{ steps.generator.outputs.deletions }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 18
- name: Run Generator
id: generator
run: |
cd generator
npm i
npm start ${{ github.event.inputs.override_version || needs.check_for_updates.outputs.id }}
- name: Needs Pull Request
if: ${{ steps.generator.outputs.deletions != '[]' && (github.event.inputs.override_version || needs.check_for_updates.outputs.id) }}
uses: peter-evans/create-pull-request@v5
with:
commit-message: "${{ (github.event.inputs.override_version || needs.check_for_updates.outputs.id) }} - deletions"
branch: "deletions-${{ (github.event.inputs.override_version || needs.check_for_updates.outputs.id) }}"
title: "Manual check of ${{ (github.event.inputs.override_version || needs.check_for_updates.outputs.id) }} deletions and possible renames"
- name: Needs Commit and Push
if: ${{ steps.generator.outputs.deletions == '[]' && (github.event.inputs.override_version || needs.check_for_updates.outputs.id) }}
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: ${{ github.event.inputs.override_version || needs.check_for_updates.outputs.id }}
tagging_message: ${{ github.event.inputs.override_version || needs.check_for_updates.outputs.id }}
push_options: '--follow-tags'
commit_author: Plagiatus <${{ secrets.email }}>