Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2

updates:
# Wait for routine releases to stabilize before Dependabot proposes them.
# GitHub intentionally bypasses cooldowns for known vulnerability fixes.
- package-ecosystem: npm
directories:
- '/'
- '/playground'
schedule:
interval: weekly
cooldown:
default-days: 7
semver-patch-days: 7
semver-minor-days: 14
semver-major-days: 30
open-pull-requests-limit: 5
assignees:
- sadjow
reviewers:
- sadjow
7 changes: 7 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ repository:
has_projects: false
has_wiki: true
default_branch: main
allow_auto_merge: true
allow_squash_merge: true
allow_merge_commit: false
allow_rebase_merge: false
Expand All @@ -12,6 +13,12 @@ repository:
branches:
- name: main
protection:
required_status_checks:
strict: true
contexts:
- 'build (20)'
- 'build (22)'

required_pull_request_reviews:
required_approving_review_count: 1

Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Dependabot auto-merge

on:
pull_request:
types: [opened, synchronize, reopened]
Comment on lines +3 to +5

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
if: >-
github.event.pull_request.user.login == 'dependabot[bot]' &&
github.repository == 'stackbuilders/nuxt-utm'
Comment on lines +14 to +15

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Is the repo check necessary?

Suggested change
github.event.pull_request.user.login == 'dependabot[bot]' &&
github.repository == 'stackbuilders/nuxt-utm'
github.event.pull_request.user.login == 'dependabot[bot]'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this is to prevent PRs from forks?

runs-on: ubuntu-latest
steps:
- name: Read Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@d7267f607e9d3fb96fc2fbe83e0af444713e90b7
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'

- name: Approve patch and minor updates
if: >-
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
steps.metadata.outputs.update-type == 'version-update:semver-minor'
run: gh pr review --approve "$PR_URL"
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
PR_URL: '${{ github.event.pull_request.html_url }}'

- name: Enable squash auto-merge for patch and minor updates
if: >-
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
steps.metadata.outputs.update-type == 'version-update:semver-minor'
run: gh pr merge --auto --squash "$PR_URL"
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
PR_URL: '${{ github.event.pull_request.html_url }}'
26 changes: 21 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: CI

on: [push, workflow_dispatch]
on:
push:
branches: [main]
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
Expand All @@ -10,21 +17,22 @@ jobs:
image: mcr.microsoft.com/playwright:v1.57.0-jammy

strategy:
fail-fast: false
matrix:
node-version: [20, 22]

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v7

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}

- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
uses: actions/cache@v6
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
Expand All @@ -40,7 +48,7 @@ jobs:
run: yarn list

- name: Install dependencies
run: yarn install
run: yarn install --frozen-lockfile

- run: yarn lint --max-warnings 0

Expand All @@ -49,3 +57,11 @@ jobs:

- name: Execute tests
run: yarn test

- name: Install playground dependencies
working-directory: playground
run: yarn install --frozen-lockfile

- name: Build playground from its lockfile
working-directory: playground
run: yarn build