diff --git a/.github/workflows/pull-request-checks.yml b/.github/workflows/pull-request-checks.yml new file mode 100644 index 0000000..52eadbc --- /dev/null +++ b/.github/workflows/pull-request-checks.yml @@ -0,0 +1,32 @@ +name: Pull Request Checks + +on: + pull_request: + +permissions: + contents: read + +jobs: + checks: + name: Tests and whitespace + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Run tests + run: npm test + + - name: Check pull request diff + env: + BASE_SHA: ${{ github.event.pull_request.base.sha }} + HEAD_SHA: ${{ github.event.pull_request.head.sha }} + run: git diff --check "$BASE_SHA" "$HEAD_SHA"