Browse Source

fix(workflows): run update-check on PRs and normalize ref resolution

Apply the same PR-safe workflow behavior used in details-check:
- Trigger update-check on pull_request to develop
- Resolve LGSM_REF to PR head SHA or branch ref name
- Use LGSM_REF for linuxgsm.sh download and LGSM_GITHUBBRANCH calls

This ensures update-check validates PR changes instead of only running on
develop pushes.
pull/4903/head
Daniel Gibbs 1 month ago
parent
commit
a621402cbf
  1. 19
      .github/workflows/update-check.yml

19
.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

Loading…
Cancel
Save