Skip to content

Commit

Permalink
ci: add pr label check and auto pr labeler (#149)
Browse files Browse the repository at this point in the history
Co-authored-by: izyak <76203436+izyak@users.noreply.github.com>
  • Loading branch information
DeepakBomjan and izyak authored Sep 11, 2023
1 parent 2e9f6b0 commit 5523f7a
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cicd:
- '.github/workflows/*'

scripts:
- 'scripts/*'

test:
- 'test/**'

documentation:
- '**/*.md'

docker:
- 'docker/**'
32 changes: 32 additions & 0 deletions .github/workflows/auto-pr-labeler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Pull Request Labeler
on:
pull_request:
types:
- opened
- edited
- synchronize
jobs:
auto-label:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Find Current Pull Request
uses: jwalton/gh-find-current-pr@v1.3.2
id: findPr
with:
# Can be "open", "closed", or "all". Defaults to "open".
state: open
- run: echo "PR Number is ${PR}"
if: success() && steps.findPr.outputs.number
env:
PR: ${{ steps.findPr.outputs.pr }}

- name: check pr pr-number
run: echo ${{ github.event.number }}

- uses: actions/labeler@v4
with:
dot: true
pr-number: ${{ steps.findPr.outputs.pr }}
20 changes: 20 additions & 0 deletions .github/workflows/check-pr-label.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: PR Label Checker
on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled

jobs:

check_labels:
name: Check PR labels
runs-on: ubuntu-latest
steps:
- uses: docker://agilepathway/pull-request-label-checker:latest
with:
any_of: documentation,enhancement,bug,cicd,test,breaking-change,feature,scripts
repo_token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 5523f7a

Please sign in to comment.