diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 000000000..8017be960 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,14 @@ +cicd: + - '.github/workflows/*' + +scripts: + - 'scripts/*' + +test: + - 'test/**' + +documentation: +- '**/*.md' + +docker: +- 'docker/**' diff --git a/.github/workflows/auto-pr-labeler.yaml b/.github/workflows/auto-pr-labeler.yaml new file mode 100644 index 000000000..906947f92 --- /dev/null +++ b/.github/workflows/auto-pr-labeler.yaml @@ -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 }} diff --git a/.github/workflows/check-pr-label.yaml b/.github/workflows/check-pr-label.yaml new file mode 100644 index 000000000..5ab02dd9f --- /dev/null +++ b/.github/workflows/check-pr-label.yaml @@ -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 }}