Skip to content

Commit

Permalink
Add github actions for PR metadata (#1833)
Browse files Browse the repository at this point in the history
Signed-off-by: Grant Griffiths <[email protected]>
  • Loading branch information
Grant Griffiths authored Mar 26, 2021
1 parent 9b48e65 commit 27ab9a5
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
area/csi:
- csi/**/*
area/ci:
- .travis
- .github/**/*
area/osd-cmd:
- osd/**/*
area/api:
- api/**/*
area/sdk-server:
- api/server/sdk/**/*
17 changes: 17 additions & 0 deletions .github/workflows/cron-stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 'Mark stale issues PR that need review'
on:
schedule:
- cron: '30 1 * * *'

jobs:
stale-in-review:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-pr-message: 'This issue is stale because it has been in review for 5 days with no activity.'
only-pr-labels: stage/in-review
days-before-stale: 5
stale-pr-label: stage/in-review-stale

33 changes: 33 additions & 0 deletions .github/workflows/on-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request.
#
# To use this workflow, you will need to set up a .github/labeler.yml
# file with configuration. For more information, see:
# https://github.com/actions/labeler

name: Labeler
on: [pull_request]
jobs:
size-label:
runs-on: ubuntu-latest
name: Label the PR size
steps:
- uses: codelytv/pr-size-labeler@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xs_max_size: '10'
s_max_size: '100'
m_max_size: '500'
l_max_size: '1000'
fail_if_xl: 'false'
message_if_xl: >
'This PR exceeds the recommended size of 1000 lines.
Please make sure you are NOT addressing multiple issues with one PR.
Note this PR might be rejected due to its size.’
github_api_url: 'api.github.com'
area-label:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
19 changes: 19 additions & 0 deletions .github/workflows/on-review-requsted.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request.
#
# To use this workflow, you will need to set up a .github/labeler.yml
# file with configuration. For more information, see:
# https://github.com/actions/labeler

name: Review requested
on:
pull_request:
types: [review_requested]
jobs:
review-label:
runs-on: ubuntu-latest
steps:
- uses: actions-ecosystem/action-add-labels@v1
with:
labels: stage/in-review
github_token: "${{ secrets.GITHUB_TOKEN }}"

0 comments on commit 27ab9a5

Please sign in to comment.