@ 261013.2
current
name: CI

on:
  push:
    branches: [main]
    paths:
      - 'proposals/**/wit/**'
      - '.github/scripts/**'
      - '.github/workflows/ci.yml'
  pull_request:
    branches: [main]
    paths:
      - 'proposals/**/wit/**'
      - '.github/scripts/**'
      - '.github/workflows/ci.yml'

jobs:
  validate:
    name: Validate WIT
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

      - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
        id: changes
        with:
          list-files: json
          filters: |
            wit:
              - 'proposals/*/wit/**'

      - name: Install tools
        if: steps.changes.outputs.wit == 'true'
        uses: ./.github/actions/install-tools

      - name: Validate changed proposals
        if: steps.changes.outputs.wit == 'true'
        run: node .github/scripts/validate-proposals.js
        env:
          WIT_FILES: ${{ steps.changes.outputs.wit_files }}