Skip to content

Commit

Permalink
Lebovits/issu791 automate pr mgmt (#795)
Browse files Browse the repository at this point in the history
* add auto labeleing and auto assigning for PRs
  • Loading branch information
nlebovits authored Jul 19, 2024
1 parent 36ff2ed commit 80eb153
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/auto_assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Set to true to add reviewers to pull requests
addReviewers: true

# Set to true to add assignees to pull requests
addAssignees: false

# A number of reviewers added to the pull request
# Set 0 to add all the reviewers (default: 0)
numberOfReviewers: 1

# Set to true to add reviewers from different groups to pull requests
useReviewGroups: true

# A list of reviewers, split into different groups, to be added to pull requests (GitHub user name)
reviewGroups:
backend:
- zigouras
frontend:
- CodeWritingCow

# Set to true to add assignees from different groups to pull requests
useAssigneeGroups: false

# A list of keywords to be skipped the process that add reviewers if pull requests include it
skipKeywords:
- wip
10 changes: 10 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
backend:
- changed-files:
- any-glob-to-any-file: 'data/**'

frontend:
- changed-files:
- any-glob-to-any-file:
- 'src/**'
- '*'
- '!(data)/**'
17 changes: 17 additions & 0 deletions .github/workflows/flag-stale-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Flag Stale PRs

on:
schedule:
- cron: '0 0 * * *' # Runs every day at midnight

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 7
stale-pr-message: 'This PR has been marked as stale because it has been open for 7 days with no activity.'
stale-pr-label: 'stale'
only-labels: 'backend, frontend'
27 changes: 27 additions & 0 deletions .github/workflows/label-and-assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Label and Assign Reviewers

on: [pull_request]

jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Label PR
uses: actions/labeler@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

assign-reviewers:
runs-on: ubuntu-latest
needs: label
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Assign Reviewers
uses: kentaro-m/auto-assign-action@v2.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: '.github/auto_assign.yml'

0 comments on commit 80eb153

Please sign in to comment.