Skip to content

Commit

Permalink
Enable automatic dependabot updates (#18)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
timomeh authored Apr 30, 2024
1 parent edea8b2 commit df3fe55
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 1 deletion.
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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'
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: pnpm build
- run: pnpm build-storybook
26 changes: 26 additions & 0 deletions .github/workflows/dependabot_auto_merge.yml
Original file line number Diff line number Diff line change
@@ -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 }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ node_modules
dist
dist-ssr
*.local
storybook-static

# Editor directories and files
.vscode/*
Expand Down
2 changes: 1 addition & 1 deletion .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down

1 comment on commit df3fe55

@timomeh
Copy link
Member Author

@timomeh timomeh commented on df3fe55 May 2, 2024

Choose a reason for hiding this comment

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

Dependabot can't parse pnpm@9's lockfiles yet. See here: dependabot/dependabot-core#9522

Please sign in to comment.