Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrating a bot to close stale issues and assign reviewers #1854

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/ci-assign-reviewers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Review Assign

on:
pull_request:
types: [opened]

jobs:
assign:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Extract reviewers from CODEOWNERS
id: extract_reviewers
run: |
# Extract reviewers from CODEOWNERS
reviewers=$(grep -Eo '@\w+' CODEOWNERS | tr '\n' ',' | sed 's/,$//')
echo "REVIEWERS=$reviewers" >> $GITHUB_ENV

- name: Assign Reviewers
uses: hkusu/review-assign-action@v1
with:
reviewers: ${{ env.REVIEWERS }}
max-num-of-reviewers: 5
23 changes: 23 additions & 0 deletions .github/workflows/ci-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Issues Workflow
on:
issues:
types: ['opened']
jobs:
Opened-issue-label:
name: Adding Issue Label
runs-on: ubuntu-latest
steps:
- uses: Renato66/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
ignore-comments: true
default-labels: '["needs-triage"]'

Issue-Greeting:
name: Greeting Message to User
runs-on: ubuntu-latest
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "Congratulations on making your first Issue! :confetti_ball: If you haven't already, check out our [Contributing Guidelines](https://github.com/kubearmor/KubeArmor/blob/main/contribution/contribution_guide.md) to ensure that you are following our guidelines for contributing and making issues."
32 changes: 32 additions & 0 deletions .github/workflows/ci-stale-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Mark stale issues and pull requests

on:
schedule:
- cron: "0 0 * * *"

permissions:
issues: write
pull-requests: write

jobs:
stale:

runs-on: ubuntu-latest

steps:
- uses: actions/stale@v8
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.'
stale-pr-message: 'This pull request did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please verify it has no conflicts with the develop branch and rebase if needed. Mention it now if you need help or give permission to other people to finish your work.'
close-issue-message: 'This issue did not get any activity in the past 180 days and thus has been closed. Please check if the newest release or develop branch has it fixed. Please, create a new issue if the issue is not fixed.'
close-pr-message: 'This pull request did not get any activity in the past 180 days and thus has been closed.'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
days-before-stale: 10
days-before-close: 180
remove-stale-when-updated: true
exempt-all-milestones: true
exempt-pr-labels: 'wip'
exempt-issue-labels: 'wip'
operations-per-run: 30
10 changes: 9 additions & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
#Kubearmor default reviewers
@Ankurk99 @achrefbensaad @PrimalPimmy
@Ankurk99
@achrefbensaad
@PrimalPimmy
@achrefbensaad
@kranurag7
@daemon1024
@nyrahul
@rksharma95
@DelusionalOptimist