diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..b1f63cf --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,35 @@ +version: 2 +updates: + - package-ecosystem: npm + directory: / + schedule: + interval: monthly + cooldown: + default-days: 7 + open-pull-requests-limit: 5 + labels: [dependencies] + commit-message: + prefix: chore + prefix-development: chore + include: scope + groups: + npm: + update-types: [minor, patch] + npm-security: + applies-to: security-updates + patterns: ["*"] + # Majors stay ungrouped: one PR each, never auto-merged. + + - package-ecosystem: github-actions + directory: / + schedule: + interval: monthly + cooldown: + default-days: 7 + labels: [dependencies] + commit-message: + prefix: ci + include: scope + groups: + actions: + patterns: ["*"] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1705ba1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node: [20, 22] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + cache: npm + - run: npm ci + - run: npm run typecheck + - run: npm run lint + - run: npm test + - run: npm run build diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml new file mode 100644 index 0000000..356a7b1 --- /dev/null +++ b/.github/workflows/dependabot-automerge.yml @@ -0,0 +1,21 @@ +name: Dependabot auto-merge + +on: pull_request + +permissions: + contents: write + pull-requests: write + +jobs: + automerge: + if: github.event.pull_request.user.login == 'dependabot[bot]' + runs-on: ubuntu-latest + steps: + - id: meta + uses: dependabot/fetch-metadata@v2 + # Majors stay open for a manual look. The merge waits for the required CI checks. + - if: steps.meta.outputs.update-type != 'version-update:semver-major' + run: gh pr merge --auto --squash "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}