-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (41 loc) Β· 1.7 KB
/
auto_dependabot.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: 'Dependabot'
on:
pull_request:
branches: [main]
types: [opened, edited, reopened, synchronize]
jobs:
autoapprovemerge:
name: Auto Approve and Merge PR
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-22.04
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Auto approve
run: |
git config --global user.name "${USER_NAME}"
git config --global user.email "${USER_EMAIL}"
git config --global credential.helper '!f() { git -c credential.helper=store --push; }; f'
gh pr review ${{ github.event.pull_request.number }} --approve --body "${APPROVE_TEXT}"
env:
GH_TOKEN: ${{ secrets.TOKEN_GITHUB }}
USER_NAME: ubunchuu[bot]
USER_EMAIL: 159746302+ubunchuu-admin@users.noreply.github.com
APPROVE_TEXT: Legit to bot β
- name: Auto merge for github_actions label
if: contains(github.event.pull_request.labels.*.name, 'github_actions')
run: |
git config --global user.name "${USER_NAME}"
git config --global user.email "${USER_EMAIL}"
curl -X PUT \
-H "Authorization: Bearer ${{ secrets.TOKEN_GITHUB }}" \
-H "Accept: application/vnd.github.v3+json" \
curl -X PUT \
-H "Authorization: Bearer ${{ secrets.TOKEN_GITHUB }}" \
-H "Accept: application/vnd.github.v3+json" \
-d '{"merge_method": "squash"}' \
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/merge"
env:
USER_NAME: ubunchuu[bot]
USER_EMAIL: 159746302+ubunchuu-admin@users.noreply.github.com