|
10 | 10 | - labeled |
11 | 11 |
|
12 | 12 | 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 | | -
|
64 | 13 | enable-automerge: |
65 | | - # Only run on Dependabot PRs after make update succeeds |
| 14 | + # Only run on Dependabot PRs |
66 | 15 | if: github.event.pull_request.user.login == 'dependabot[bot]' |
67 | | - needs: dependabot-make-update |
68 | 16 | runs-on: ubuntu-latest |
69 | 17 | permissions: |
70 | 18 | contents: write |
|
77 | 25 | with: |
78 | 26 | github-token: ${{ secrets.GITHUB_TOKEN }} |
79 | 27 |
|
| 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 | + |
80 | 34 | - name: Enable auto-merge for Dependabot PRs |
81 | 35 | if: steps.metadata.outputs.update-type == 'version-update:semver-patch' |
82 | 36 | run: gh pr merge --auto --squash "$PR_URL" |
|
0 commit comments