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

ci: add pr label check and auto pr labeler #149

Merged
merged 3 commits into from
Sep 11, 2023
Merged
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
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
debendraoli marked this conversation as resolved.
Show resolved Hide resolved
jobs:
auto-label:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Find Current Pull Request
uses: jwalton/[email protected]
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
debendraoli marked this conversation as resolved.
Show resolved Hide resolved
- reopened
- labeled
- unlabeled
debendraoli marked this conversation as resolved.
Show resolved Hide resolved

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 }}
Loading