Skip to content

Commit c4883d9

Browse files
AST-13072 - Improve PR handling (#148)
- Added dependabot auto merge - Auto assign PR - Add reviewers to PR
1 parent 0dc1763 commit c4883d9

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@ updates:
99
directory: "/" # Location of package manifests
1010
schedule:
1111
interval: "daily"
12+
reviewers:
13+
- "Checkmarx/ast-galactica-team"
1214

1315
- package-ecosystem: "github-actions"
1416
# Workflow files stored in the
1517
# default location of `.github/workflows`
1618
directory: "/"
1719
schedule:
1820
interval: "daily"
21+
reviewers:
22+
- "Checkmarx/ast-galactica-team"
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Dependabot auto-merge
2+
on: pull_request
3+
4+
permissions:
5+
contents: write
6+
7+
jobs:
8+
dependabot-merge:
9+
runs-on: ubuntu-latest
10+
if: ${{ github.actor == 'dependabot[bot]' }}
11+
steps:
12+
- name: Dependabot metadata
13+
id: metadata
14+
uses: dependabot/fetch-metadata@v1.3.1
15+
with:
16+
github-token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
17+
- name: Enable auto-merge for Dependabot PRs
18+
env:
19+
PR_URL: ${{github.event.pull_request.html_url}}
20+
GITHUB_TOKEN: ${{secrets.PERSONAL_ACCESS_TOKEN }}
21+
run: gh pr merge --auto --merge "$PR_URL"
22+
- name: Auto approve dependabot PRs
23+
uses: hmarr/auto-approve-action@v2
24+
with:
25+
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: PR Automation
2+
on:
3+
pull_request_target:
4+
types: [ready_for_review, opened, reopened]
5+
6+
permissions:
7+
contents: none
8+
issues: write
9+
pull-requests: write
10+
11+
jobs:
12+
add-reviewers:
13+
runs-on: ubuntu-latest
14+
if: ${{ github.event.pull_request.user.type != 'Bot' }}
15+
steps:
16+
- name: Request reviewers
17+
env:
18+
GH_REPO: ${{ github.repository }}
19+
GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
20+
PRNUM: ${{ github.event.pull_request.number }}
21+
PRAUTHOR: ${{ github.event.pull_request.user.login }}
22+
run: gh pr edit $PRNUM --add-reviewer Checkmarx/ast-galactica-team

0 commit comments

Comments
 (0)