name: PR Check

on:
  push:
    branches:
      - master
      - 7.[0-9]+.x

  pull_request:
    branches:
      - master
      - 7.[0-9]+.x

jobs:
  pr-check:
    name: Java ${{ matrix.java }}
    runs-on: ubuntu-latest
    strategy:
      matrix:
        java: [8, 11]
      fail-fast: false
    steps:
      - name: Check  out Git repository
        uses: actions/checkout@v2
      - name: Set up JDK
        uses: actions/setup-java@v2
        with:
          java-version: ${{ matrix.java }}
          distribution: adopt
      # See https://docs.github.com/en/actions/guides/building-and-testing-java-with-maven#caching-dependencies
      - name: Cache Maven packages
        uses: actions/cache@v2
        with:
          path: ~/.m2
          key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
          restore-keys: ${{ runner.os }}-m2
      - name: Maven Build using Java ${{ matrix.java-version }}
        run: mvn -B --fail-at-end clean install

name: PR Check

on:
  push:
    branches:
      - main
      - 7.[0-9]+.x

  pull_request:
    branches:
      - main
      - 7.[0-9]+.x

jobs:
  pr-check:
    name: Java ${{ matrix.java }}
    runs-on: ubuntu-latest
    strategy:
      matrix:
        java: [8, 11]
      fail-fast: false
    steps:
      - name: Check  out Git repository
        uses: actions/checkout@v2
      - name: Set up JDK
        uses: actions/setup-java@v2
        with:
          java-version: ${{ matrix.java }}
          distribution: adopt
      # See https://docs.github.com/en/actions/guides/building-and-testing-java-with-maven#caching-dependencies
      - name: Cache Maven packages
        uses: actions/cache@v2
        with:
          path: ~/.m2
          key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
          restore-keys: ${{ runner.os }}-m2
      - name: Maven Build using Java ${{ matrix.java-version }}
        run: mvn -B --fail-at-end clean install

Change GitHub action to run pull request changes on main
Change GitHub action to run pull request changes on main
