name: Test
"on":
  push: {}
  pull_request:
    types:
      - opened
      - synchronize
jobs:
  integration:
    runs-on: ubuntu-latest
    if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main'
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          cache: npm
          node-version: 18
      - run: npm ci
      - run: npm test
  createComment:
    runs-on: ubuntu-latest
    permissions:
      issues: write # to be able to comment on released issues
      pull-requests: write # to be able to comment on released pull requests
    if: github.event_name == 'push'
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          cache: npm
          node-version: 18
      - run: npm ci
      - run: node test/fixtures/app.js
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
