From df3fe5528b23512ab993135083b027e95f07a29a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20M=C3=A4mecke?= Date: Tue, 30 Apr 2024 10:05:59 +0200 Subject: [PATCH] Enable automatic dependabot updates (#18) - Enables automatic dependabot updates - Enables auto-merge of dependabot PRs for patch and minor semver dependency updates - Configured some dependency groups to group common dependencies together, so there's less PR noise - Adds storybook to CI, so we know that storybook still works - Fixes an old import path in storybook --- .github/dependabot.yml | 19 +++++++++++++++ .github/workflows/ci.yml | 1 + .github/workflows/dependabot_auto_merge.yml | 26 +++++++++++++++++++++ .gitignore | 1 + .storybook/preview.tsx | 2 +- 5 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/dependabot_auto_merge.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..8999dcd --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,19 @@ +version: 2 +updates: + - package-ecosystem: 'npm' + directory: '/' + schedule: + interval: 'daily' + groups: + lint: + patterns: + - 'prettier*' + - 'eslint*' + storybook: + patterns: + - '@storybook*' + - 'storybook' + react: + patterns: + - 'react' + - 'react-dom' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f900b87..911d62c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,3 +29,4 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/setup - run: pnpm build + - run: pnpm build-storybook diff --git a/.github/workflows/dependabot_auto_merge.yml b/.github/workflows/dependabot_auto_merge.yml new file mode 100644 index 0000000..1b6e5f2 --- /dev/null +++ b/.github/workflows/dependabot_auto_merge.yml @@ -0,0 +1,26 @@ +name: Dependabot auto-merge +on: pull_request + +permissions: + contents: write + pull-requests: write + +# Allow dependabot PRs (which aren't major upgrades) to be automatically merged. +# Waits with a branch protection rule for all status checks to pass. + +jobs: + dependabot: + runs-on: ubuntu-latest + if: github.actor == 'dependabot[bot]' + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Enable auto-merge for Dependabot PRs + 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: + PR_URL: ${{ github.event.pull_request.html_url }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index a547bf3..a526948 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ node_modules dist dist-ssr *.local +storybook-static # Editor directories and files .vscode/* diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 3772954..0198c5d 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -2,7 +2,7 @@ import React from 'react' import type { Preview } from '@storybook/preact' import './styles.css' -import '../lib/PortingEmbed/styles.css' +import '../lib/styles/styles.css' const preview: Preview = { decorators: [