---
name: checkrefs
on:
  - push
  - pull_request
jobs:
  checkrefs:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.11"
      - name: Install lxml
        run: pip3 install lxml
      - name: Workaround for authentication problem with LFS
        # https://gitea.com/gitea/act_runner/issues/164
        run: >
          git config --local
          http.${{ gitea.server_url }}/${{ gitea.repository }}.git/info/lfs/objects/.extraheader ''
      - name: Download necessary LFS assets
        run: git lfs pull -I binaries/data/mods/public/maps
      - name: Check for missing references
        run: ./source/tools/entity/checkrefs.py
