Skip to content

Commit d94909f

Browse files
mesh-2092: remove make update and add auto approve
1 parent af19943 commit d94909f

1 file changed

Lines changed: 7 additions & 53 deletions

File tree

.github/workflows/dependabot-auto-merge.yaml

Lines changed: 7 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -10,61 +10,9 @@ on:
1010
- labeled
1111

1212
jobs:
13-
dependabot-make-update:
14-
# Only run on Dependabot PRs
15-
if: github.event.pull_request.user.login == 'dependabot[bot]'
16-
runs-on: ubuntu-latest
17-
permissions:
18-
contents: write
19-
20-
steps:
21-
- name: Checkout
22-
uses: actions/checkout@v4
23-
with:
24-
fetch-depth: 0
25-
repository: ${{ github.event.pull_request.head.repo.full_name }}
26-
27-
- name: Install Python 3.11
28-
uses: actions/setup-python@v4
29-
with:
30-
python-version: '3.11'
31-
32-
- name: Install poetry
33-
run: python -m pip install --upgrade pip setuptools wheel poetry
34-
35-
- name: Install project dependencies
36-
run: make install-ci
37-
38-
- name: Update dependencies (make update)
39-
run: make update
40-
41-
- name: Lint (make lint)
42-
run: make lint
43-
44-
- name: Commit and push changes
45-
env:
46-
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
47-
run: |
48-
git config user.name "github-actions[bot]"
49-
git config user.email "github-actions[bot]@users.noreply.github.com"
50-
51-
if [ -z "$PR_HEAD_REF" ] || ! echo "$PR_HEAD_REF" | grep -Eq '^dependabot/'; then
52-
echo "PR head ref '$PR_HEAD_REF' is not a allowed Dependabot branch; skipping push."
53-
exit 1
54-
fi
55-
56-
if git status --porcelain | grep .; then
57-
git add -A
58-
git commit -m "mesh-2092: apply make update changes"
59-
git push origin HEAD:"$PR_HEAD_REF"
60-
else
61-
echo "No changes to commit"
62-
fi
63-
6413
enable-automerge:
65-
# Only run on Dependabot PRs after make update succeeds
14+
# Only run on Dependabot PRs
6615
if: github.event.pull_request.user.login == 'dependabot[bot]'
67-
needs: dependabot-make-update
6816
runs-on: ubuntu-latest
6917
permissions:
7018
contents: write
@@ -77,6 +25,12 @@ jobs:
7725
with:
7826
github-token: ${{ secrets.GITHUB_TOKEN }}
7927

28+
- name: Auto-approve Dependabot PR
29+
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
30+
uses: hmarr/auto-approve-action@v4
31+
with:
32+
github-token: ${{ secrets.GITHUB_TOKEN }}
33+
8034
- name: Enable auto-merge for Dependabot PRs
8135
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
8236
run: gh pr merge --auto --squash "$PR_URL"

0 commit comments

Comments
 (0)