chore: harden dependabot updates

This commit is contained in:
xixu-me committed 2026-03-17 15:13:01 +08:00
1 parent a01ed0a765
commit e38d29665b
6 files changed
+2931 -2003

No files matched your search

+40
View File
@@ -0,0 +1,40 @@
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
day: monday
time: "09:00"
timezone: Asia/Shanghai
open-pull-requests-limit: 5
versioning-strategy: increase-if-necessary
commit-message:
prefix: chore
include: scope
labels:
- dependencies
- npm
groups:
app-dependencies:
patterns:
- "*"
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
day: monday
time: "09:30"
timezone: Asia/Shanghai
open-pull-requests-limit: 3
commit-message:
prefix: chore
include: scope
labels:
- dependencies
- github-actions
groups:
github-actions:
patterns:
- "*"
+40
View File
@@ -0,0 +1,40 @@
name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 10.32.1
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Audit production dependencies
run: pnpm audit --prod --audit-level=high
- name: Build Nitro app
run: pnpm build
@@ -0,0 +1,38 @@
name: Dependabot Auto Merge
on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
permissions:
contents: write
pull-requests: write
jobs:
enable-automerge:
if: github.event.pull_request.user.login == 'dependabot[bot]'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Fetch Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@d7267f607e9d3fb96fc2fbe83e0af444713e90b7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Enable auto-merge for patch updates
if: |
(github.event.pull_request.base.ref == 'main') &&
(
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
steps.metadata.outputs.update-type == 'security:update'
)
run: gh pr merge --auto --merge "$PR_URL"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}