diff --git a/.github/workflows/close_invalid_prs.yml b/.github/workflows/close_invalid_prs.yml new file mode 100644 index 0000000..9064b67 --- /dev/null +++ b/.github/workflows/close_invalid_prs.yml @@ -0,0 +1,18 @@ +# Thanks paper: https://github.com/papermc/paper/blob/master/.github/workflows/close_invalid_prs.yml +name: Close invalid PRs + +on: + pull_request_target: + types: [ opened ] + +jobs: + run: + if: ${{ github.repository != github.event.pull_request.head.repo.full_name && github.head_ref == 'master' }} + runs-on: ubuntu-latest + steps: + - uses: superbrothers/close-pull-request@v3 + id: "master_branch" + if: github.head_ref == 'master' + with: + comment: | + Hi there! :wave: This PR is targeting the `master` branch, which is not allowed. Please target the `develop` branch instead. Thanks! \ No newline at end of file diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml new file mode 100644 index 0000000..f682d7c --- /dev/null +++ b/.github/workflows/test-pr.yml @@ -0,0 +1,24 @@ +name: Test PR +on: [pull_request] +jobs: + build_pr: + if: github.repository_owner == 'theEvilReaper' + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v3 + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 21 + - name: Build with ${{ matrix.os }} + run: | + git config --global user.email "no-reply@github.com" + git config --global user.name "Github Actions" + ./gradlew test