generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 14
41 lines (39 loc) · 1.47 KB
/
dependabot-automerge.yaml
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
name: dependabot merger
on:
pull_request:
branches: [ main ]
jobs:
review-pr:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' &&
github.event_name == 'pull_request' }}
permissions:
pull-requests: write
contents: write
steps:
- name: dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2.0.0
with:
github-token: ${{ secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR }}
- name: "Prepare git"
run: |
git config --global user.email "cloudsdk@sap.com"
git config --global user.name "SAP Cloud SDK Bot"
- name: comment major updates
if : ${{steps.metadata.outputs.update-type == 'version-update:semver-major' }}
run: |
gh pr comment $PR_URL --body "PR **not approved** because it includes a major update of a dependency"
gh pr edit $PR_URL --add-label "please review"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR}}
- name: approve and merge
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
run: |
gh pr review --approve "$PR_URL"
gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR}}