mirror of
https://github.com/Manavarya09/design-extract.git
synced 2026-09-19 02:41:14 +08:00
ci: enable Dependabot with auto-merge for patch & minor updates (#148)
Adds .github/dependabot.yml (weekly npm + github-actions; minor/patch grouped) and a dependabot-auto-merge workflow that enables GitHub auto-merge (gh pr merge --auto --squash) for patch & minor bumps, leaving major versions for manual review. Uses fetch-metadata; PR URL passed via a quoted env var (no injection); does not check out PR code. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
version: 2
|
||||
updates:
|
||||
# npm dependencies — group low-risk bumps so auto-merge handles them in one PR.
|
||||
- package-ecosystem: npm
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: weekly
|
||||
open-pull-requests-limit: 10
|
||||
labels:
|
||||
- dependencies
|
||||
groups:
|
||||
minor-and-patch:
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
|
||||
# Keep GitHub Actions pinned and current.
|
||||
- package-ecosystem: github-actions
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: weekly
|
||||
labels:
|
||||
- dependencies
|
||||
- github-actions
|
||||
@@ -0,0 +1,33 @@
|
||||
name: Dependabot auto-merge
|
||||
|
||||
# Auto-merge Dependabot PRs for low-risk updates (patch + minor, and any
|
||||
# security patch). Major version bumps are left for manual review.
|
||||
#
|
||||
# Requires "Allow auto-merge" enabled on the repo. `gh pr merge --auto` queues
|
||||
# the merge so it only lands once required status checks pass.
|
||||
|
||||
on: pull_request_target
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
auto-merge:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.actor == 'dependabot[bot]' }}
|
||||
steps:
|
||||
- name: Fetch Dependabot metadata
|
||||
id: meta
|
||||
uses: dependabot/fetch-metadata@v2
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Enable auto-merge for patch & minor updates
|
||||
if: >-
|
||||
steps.meta.outputs.update-type == 'version-update:semver-patch' ||
|
||||
steps.meta.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 }}
|
||||
Reference in New Issue
Block a user