Skip to content

Action updates

Action updates #7

name: Check PR local changes
on:
pull_request:
types:
- synchronize
- opened
- ready_for_review
- reopened
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1000
fetch-tags: true
# GradleUtils will append the branch name to the version,
# but for that we need a properly checked out branch
- name: Create branch for commit
run:
git switch -C pr-${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.ref }}
- name: Setup JDK 21
uses: actions/setup-java@v2
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Setup with Gradle
run: ./gradlew setup
- name: Run datagen with Gradle
run: ./gradlew :neoforge:runData :tests:runData
- name: Check local changes
id: check
run: |
chmod +x ./.github/workflows/check-local-changes.sh
./.github/workflows/check-local-changes.sh
- name: Output changed files
run: git status --porcelain ./*/src/generated/resources/*
- name: Fail if local changes are detected
if: steps.check.outputs.changed == '1'
run: exit 1