Skip to content

Commit 598dc96

Browse files
committed
chore: use github bot for approving PR
1 parent 08d3e3f commit 598dc96

File tree

3 files changed

+17
-22
lines changed

3 files changed

+17
-22
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ updates:
66
interval: "cron"
77
cronjob: "0 0 * * *"
88
groups:
9-
action-minor:
10-
update-types:
11-
- minor
12-
- patch
9+
actions-major:
10+
patterns:
11+
- "*"
1312
- package-ecosystem: "gomod"
1413
directories:
1514
- "/"
@@ -28,10 +27,9 @@ updates:
2827
interval: "cron"
2928
cronjob: "0 0 * * *"
3029
groups:
31-
npm-minor:
32-
update-types:
33-
- minor
34-
- patch
30+
npm-major:
31+
patterns:
32+
- "*"
3533
- package-ecosystem: "docker"
3634
directory: "pkg/config/templates"
3735
schedule:

.github/workflows/api-sync.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: API Sync
22

33
on:
44
repository_dispatch:
5-
types: [api-sync]
5+
types:
6+
- api-sync
67
workflow_dispatch: # allow manual triggering
78

89
# Add explicit permissions
@@ -57,12 +58,15 @@ jobs:
5758
Changes were detected in the generated API code after syncing with the latest spec from infrastructure.
5859
branch: sync/api-types
5960
base: develop
60-
labels: |
61-
automated pr
62-
api-sync
61+
62+
- name: Approve a PR
63+
if: steps.check.outputs.has_changes == 'true'
64+
run: gh pr review --approve "${{ steps.cpr.outputs.pull-request-number }}"
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6367

6468
- name: Enable Pull Request Automerge
6569
if: steps.check.outputs.has_changes == 'true'
6670
run: gh pr merge --auto --squash "${{ steps.cpr.outputs.pull-request-number }}"
6771
env:
68-
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/automerge.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,17 @@ jobs:
2222
with:
2323
github-token: "${{ secrets.GITHUB_TOKEN }}"
2424

25-
- name: Generate token
26-
id: app-token
27-
uses: actions/create-github-app-token@v2
28-
with:
29-
app-id: ${{ secrets.APP_ID }}
30-
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
31-
3225
# Here the PR gets approved.
3326
- name: Approve a PR
3427
if: ${{ steps.meta.outputs.update-type == 'version-update:semver-patch' || (!startsWith(steps.meta.outputs.previous-version, '0.') && steps.meta.outputs.update-type == 'version-update:semver-minor') }}
3528
run: gh pr review --approve "${{ github.event.pull_request.html_url }}"
3629
env:
37-
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3831

3932
# Finally, this sets the PR to allow auto-merging for patch and minor
4033
# updates if all checks pass
4134
- name: Enable auto-merge for Dependabot PRs
4235
if: ${{ steps.meta.outputs.update-type == 'version-update:semver-patch' || (!startsWith(steps.meta.outputs.previous-version, '0.') && steps.meta.outputs.update-type == 'version-update:semver-minor') }}
4336
run: gh pr merge --auto --squash "${{ github.event.pull_request.html_url }}"
4437
env:
45-
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)