diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml index 8863cedc7..3c67b087f 100644 --- a/.github/workflows/update-check.yml +++ b/.github/workflows/update-check.yml @@ -5,6 +5,9 @@ on: push: branches: - develop + pull_request: + branches: + - develop permissions: {} @@ -16,6 +19,8 @@ jobs: update-check: if: github.repository_owner == 'GameServerManagers' runs-on: ubuntu-latest + env: + LGSM_REF: ${{ github.event.pull_request.head.sha || github.ref_name }} strategy: fail-fast: false @@ -24,30 +29,30 @@ jobs: steps: - name: Download linuxgsm.sh - run: wget "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh"; chmod +x linuxgsm.sh + run: wget "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${LGSM_REF}/linuxgsm.sh"; chmod +x linuxgsm.sh - name: Install dependencies run: sudo dpkg --add-architecture i386; sudo apt-get update; - name: Grab server - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./linuxgsm.sh ${{ matrix.shortname }}server - name: Enable developer mode - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server developer + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server developer - name: Insert steamuser if: matrix.shortname == 'jk2' run: echo -e "steamuser=\"${{ secrets.STEAMCMD_USER }}\"\nsteampass='${{ secrets.STEAMCMD_PASS }}'" > lgsm/config-lgsm/${{ matrix.shortname }}server/common.cfg - name: Install server - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server auto-install + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server auto-install - name: Check Update server - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server check-update + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server check-update - name: Update server - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server update + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server update - name: Force Update server if: matrix.shortname == 'css' - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server force-update + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server force-update