Skip to content

[AUTOMATIC] Contribute: content/add-community #74

[AUTOMATIC] Contribute: content/add-community

[AUTOMATIC] Contribute: content/add-community #74

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" \
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/merge?merge_method=squash"
env:
USER_NAME: ubunchuu[bot]
USER_EMAIL: 159746302+ubunchuu-admin@users.noreply.github.com