Skip to content

Commit a060e01

Browse files
Merge pull request #12 from wptrainingteam/copilot/create-dependabot-workflows
Add Dependabot automation workflows for auto-approve and auto-merge
2 parents 311a50c + 272d145 commit a060e01

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Dependabot Auto-Approve
2+
on: pull_request
3+
4+
permissions:
5+
pull-requests: write
6+
7+
jobs:
8+
dependabot-approve:
9+
runs-on: ubuntu-latest
10+
if: github.actor == 'dependabot[bot]'
11+
steps:
12+
- name: Dependabot metadata
13+
id: metadata
14+
uses: dependabot/fetch-metadata@v2
15+
with:
16+
github-token: "${{ secrets.GITHUB_TOKEN }}"
17+
18+
- name: Approve Dependabot PR
19+
run: gh pr review --approve "$PR_URL"
20+
env:
21+
PR_URL: ${{ github.event.pull_request.html_url }}
22+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Dependabot Auto-Merge
2+
on: pull_request
3+
4+
permissions:
5+
contents: write
6+
pull-requests: write
7+
8+
jobs:
9+
dependabot-auto-merge:
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@v2
16+
with:
17+
github-token: "${{ secrets.GITHUB_TOKEN }}"
18+
19+
- name: Enable auto-merge for Dependabot PRs
20+
run: gh pr merge --auto --merge "$PR_URL"
21+
env:
22+
PR_URL: ${{ github.event.pull_request.html_url }}
23+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)