Skip to content

Commit e130f20

Browse files
[MARIO-570] Adding dependabot autoappoval/merge (#61)
* Adding dependabot autoappoval/merge * address dir path and remove docker compose file from codeowners * adding github actions ecosystem * fix trailing newline, add open-pull-requests-limit to github-actions ecosystem, add workflow paths to CODEOWNERS for bot approval --------- Co-authored-by: Michael Day <michael.day@wpengine.com>
1 parent f9c4b3e commit e130f20

3 files changed

Lines changed: 51 additions & 5 deletions

File tree

.github/CODEOWNERS

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
* @wpengine/mario
1+
* @wpengine/mario
2+
3+
# Dependency files: both the bot and the team are code owners for these paths
4+
package.json @pe-domino-bot @wpengine/mario
5+
package-lock.json @pe-domino-bot @wpengine/mario
6+
Dockerfile @pe-domino-bot @wpengine/mario
7+
.github/workflows/*.yml @pe-domino-bot @wpengine/mario
8+
.github/workflows/*.yaml @pe-domino-bot @wpengine/mario

.github/dependabot.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,23 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "daily"
7+
ignore:
8+
- dependency-name: "*"
9+
update-types: ["version-update:semver-major"]
10+
open-pull-requests-limit: 10
11+
- package-ecosystem: "github-actions"
12+
directory: "/"
13+
schedule:
14+
interval: "daily"
15+
ignore:
16+
- dependency-name: "*"
17+
update-types: ["version-update:semver-major"]
718
open-pull-requests-limit: 10
8-
reviewers:
9-
- "wpengine/mario"
1019
- package-ecosystem: "npm"
1120
directory: "/"
1221
schedule:
1322
interval: "daily"
23+
ignore:
24+
- dependency-name: "*"
25+
update-types: ["version-update:semver-major"]
1426
open-pull-requests-limit: 10
15-
reviewers:
16-
- "wpengine/mario"
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Dependabot Automation
2+
on: pull_request
3+
4+
permissions:
5+
contents: write
6+
pull-requests: write
7+
8+
jobs:
9+
dependabot:
10+
runs-on: ubuntu-latest
11+
if: ${{github.actor == 'dependabot[bot]'}}
12+
steps:
13+
- name: Dependabot metadata
14+
id: metadata
15+
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0
16+
with:
17+
github-token: "${{secrets.GITHUB_TOKEN}}"
18+
- name: Approve PR
19+
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
20+
env:
21+
PR_URL: ${{github.event.pull_request.html_url}}
22+
GH_TOKEN: ${{secrets.BOT_APPROVAL_TOKEN}}
23+
run: gh pr review --approve "$PR_URL"
24+
- name: Enable auto-merge
25+
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
26+
env:
27+
PR_URL: ${{github.event.pull_request.html_url}}
28+
GH_TOKEN: ${{secrets.BOT_APPROVAL_TOKEN}}
29+
run: gh pr merge --auto --squash "$PR_URL"

0 commit comments

Comments
 (0)