diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..77b289a --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,26 @@ +name: Validate pull requests + +on: + pull_request: + push: + branches: [main] + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + fetch-depth: 2 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + - name: Run tests + run: npm test + - name: Check whitespace errors in latest commit + run: git diff --check HEAD^ HEAD