diff --git a/.github/label-pr.json b/.github/label-pr.json new file mode 100644 index 000000000..a534c39e7 --- /dev/null +++ b/.github/label-pr.json @@ -0,0 +1,21 @@ +{ + "title_patterns": { + "t:feature": ["feat", "feature", "tool"], + "t:bugfix": ["fix", "bug", "bugfix"], + "t:tech-debt": ["refactor", "chore", "cleanup", "revert", "debt", "test", "perf"], + "t:docs": ["docs"], + "t:ci": ["ci", "build", "chore(ci)"], + "t:deps": ["deps", "[deps]"], + "t:breaking-change": ["breaking", "breaking-change"], + "t:misc": ["misc"], + "t:llm": ["llm"] + }, + "path_patterns": { + "t:feature": [], + "t:tech-debt": [], + "t:ci": [".checkmarx/", ".github/"], + "t:docs": ["README.md", "CONTRIBUTING.md", "SECURITY.md"], + "t:deps": [], + "t:llm": [".claude/"] + } +} diff --git a/.github/workflows/auto-label-pr-sdlc.yml b/.github/workflows/auto-label-pr-sdlc.yml new file mode 100644 index 000000000..a068ac7ed --- /dev/null +++ b/.github/workflows/auto-label-pr-sdlc.yml @@ -0,0 +1,29 @@ +name: Label PR +run-name: Label PR #${{ github.event.pull_request.number }} + +on: + pull_request: + types: [opened, synchronize, reopened] + +permissions: {} + +jobs: + label: + name: Label PR + runs-on: ubuntu-24.04 + permissions: + contents: read + pull-requests: write + steps: + - name: Check out repo + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + - name: Label PR + uses: bitwarden/gh-actions/auto-label-pr-sdlc@main + with: + pr-number: ${{ github.event.pull_request.number }} + pr-labels: ${{ toJSON(github.event.pull_request.labels) }} + mode: add + github-token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file