Skip to content

Commit

Permalink
Merge pull request #1 from sankichi92/setup-dependabot
Browse files Browse the repository at this point in the history
Setup Dependabot
  • Loading branch information
sankichi92 authored Jul 2, 2024
2 parents 366e13b + 47c5fe6 commit 20199f7
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2

updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
day: friday
time: "20:00"
timezone: Asia/Tokyo

- package-ecosystem: npm
directory: /
schedule:
interval: weekly
day: friday
time: "20:00"
timezone: Asia/Tokyo
32 changes: 32 additions & 0 deletions .github/workflows/dependabot-automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Dependabot

on:
pull_request:
branches: ["main"]

jobs:
auto-merge:
if: github.actor == 'dependabot[bot]'

runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write

steps:
- name: Fetch dependabot metadata
id: metadata
uses: dependabot/[email protected]
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Enable auto-merge
if: |
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
(steps.metadata.outputs.dependency-type != 'direct:production' && steps.metadata.outputs.update-type != 'version-update:semver-major') ||
(steps.metadata.outputs.package-ecosystem == 'github_actions' && steps.metadata.outputs.update-type != 'version-update:semver-major')
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 comments on commit 20199f7

Please sign in to comment.