name: Check vcpkg Tools SHA

on:
  pull_request:
    paths:
      - "scripts/vcpkg-tools.json"

permissions:
  contents: read

jobs:
  check-tools-sha:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Bootstrap vcpkg
        run: ./bootstrap-vcpkg.sh

      - name: Run vcpkg x-check-tools-sha
        run: vcpkg z-check-tools-sha scripts/vcpkg-tools.json || echo "Run 'vcpkg z-check-tools-sha scripts/vcpkg-tools.json --fix' to update the SHA values"
