Skip to content

Commit

Permalink
Update workflows and add dependabot auto-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ylabonte committed Apr 2, 2024
1 parent 32193d3 commit d6236d0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ updates:
directory: "/"
schedule:
interval: "weekly"
assignees:
- ylabonte

- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
ignore:
# Dependabot should not update Home Assistant as that should match the homeassistant key in hacs.json
- dependency-name: "homeassistant"
- dependency-name: "homeassistant"
assignees:
- ylabonte
27 changes: 27 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Auto-Merge Dependabot PRs"

on:
pull_request:
branches:
- "master"

permissions:
contents: write
pull-requests: write

jobs:
automerge:
name: "Auto-approve PR"
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]' || github.actor == 'ylabonte'
steps:
- name: "Approve PR to enable auto-merge"
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: "Auto-merge PR"
run: gh pr merge --merge --auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 comments on commit d6236d0

Please sign in to comment.