From dccc2c89dff63c1f7b3361f9d9dd3ed7602f9841 Mon Sep 17 00:00:00 2001 From: Daniel James Smith Date: Wed, 29 Jul 2026 12:00:23 +0200 Subject: [PATCH 1/4] Add workflow to automatically label a PR by change type --- .github/label-pr.json | 22 ++++++++++++++++++ .github/workflows/auto-label-pr-sdlc.yml | 29 ++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 .github/label-pr.json create mode 100644 .github/workflows/auto-label-pr-sdlc.yml diff --git a/.github/label-pr.json b/.github/label-pr.json new file mode 100644 index 000000000..dea34a115 --- /dev/null +++ b/.github/label-pr.json @@ -0,0 +1,22 @@ +{ + "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": { + "feature-flag": [], + "t:feature": [], + "t:tech-debt": [], + "t:ci": [".checkmarx/", ".github/", "scripts/"], + "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..0aaa606da --- /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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + 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 From 3d5db7f0acd0f25ec0a69fdd0cf41bbed392ba8d Mon Sep 17 00:00:00 2001 From: Daniel James Smith Date: Wed, 29 Jul 2026 12:02:37 +0200 Subject: [PATCH 2/4] Remove "scripts/" from t:ci --- .github/label-pr.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/label-pr.json b/.github/label-pr.json index dea34a115..b67fef5b4 100644 --- a/.github/label-pr.json +++ b/.github/label-pr.json @@ -14,7 +14,7 @@ "feature-flag": [], "t:feature": [], "t:tech-debt": [], - "t:ci": [".checkmarx/", ".github/", "scripts/"], + "t:ci": [".checkmarx/", ".github/"], "t:docs": ["README.md", "CONTRIBUTING.md", "SECURITY.md"], "t:deps": [], "t:llm": [".claude/"] From d43a4da11942817dd30a23cdff4fc1fb9eadf77e Mon Sep 17 00:00:00 2001 From: Daniel James Smith <2670567+djsmith85@users.noreply.github.com> Date: Wed, 29 Jul 2026 12:11:37 +0200 Subject: [PATCH 3/4] Match version of actions/checkout with the other usages in the repo Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/auto-label-pr-sdlc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-label-pr-sdlc.yml b/.github/workflows/auto-label-pr-sdlc.yml index 0aaa606da..a068ac7ed 100644 --- a/.github/workflows/auto-label-pr-sdlc.yml +++ b/.github/workflows/auto-label-pr-sdlc.yml @@ -16,7 +16,7 @@ jobs: pull-requests: write steps: - name: Check out repo - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false From b2401fa715d58723f985a48f60a047f7ee010de6 Mon Sep 17 00:00:00 2001 From: Daniel James Smith <2670567+djsmith85@users.noreply.github.com> Date: Wed, 29 Jul 2026 12:12:11 +0200 Subject: [PATCH 4/4] Remove feature-flag entry as the label isn't present on the DC repo Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/label-pr.json | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/label-pr.json b/.github/label-pr.json index b67fef5b4..a534c39e7 100644 --- a/.github/label-pr.json +++ b/.github/label-pr.json @@ -11,7 +11,6 @@ "t:llm": ["llm"] }, "path_patterns": { - "feature-flag": [], "t:feature": [], "t:tech-debt": [], "t:ci": [".checkmarx/", ".github/"],