From 32c0e1aa2d95ba0c92b4288e6577e81bd9589e61 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 4 Jun 2026 15:03:18 +0700 Subject: [PATCH 1/2] ci(labeler): auto-apply Port labels from changed driver files Add path-based labeling so a PR touching a dcd/hcd driver under src/portable/ gets the matching "Port " label automatically. - new .github/labeler.yml maps each portable driver dir to its Port label - new label-port job runs actions/labeler on pull_request_target (opened/synchronize/reopened), sync-labels: false so manual removals stick - guard the existing author-based label-priority job to opened-only so it isn't re-run on PR updates - WCH is split per-IP: *usbfs* -> Port WCH USBFS, *usbhs* -> Port WCH USBHS Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/labeler.yml | 77 +++++++++++++++++++++++++++++++++++ .github/workflows/labeler.yml | 18 +++++++- 2 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 .github/labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000000..6c7aa7e7d9 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,77 @@ +# Path-based auto-labeling for USB IP / port drivers. +# Maps changed dcd/hcd files under src/portable/ to their "Port " label. +# Consumed by actions/labeler (see .github/workflows/labeler.yml -> label-port job). + +"Port DWC2": + - changed-files: + - any-glob-to-any-file: 'src/portable/synopsys/dwc2/**' + +"Port EHCI": + - changed-files: + - any-glob-to-any-file: 'src/portable/ehci/**' + +"Port OHCI": + - changed-files: + - any-glob-to-any-file: 'src/portable/ohci/**' + +"Port FSDev": + - changed-files: + - any-glob-to-any-file: 'src/portable/st/stm32_fsdev/**' + +"Port ChipIdea": + - changed-files: + - any-glob-to-any-file: 'src/portable/chipidea/**' + +"Port NXP IP3511": + - changed-files: + - any-glob-to-any-file: 'src/portable/nxp/lpc_ip3511/**' + +"Port NXP IP3516": + - changed-files: + - any-glob-to-any-file: 'src/portable/nxp/lpc_ip3516/**' + +"Port MUSB": + - changed-files: + - any-glob-to-any-file: + - 'src/portable/mentor/musb/**' + - 'src/portable/sunxi/**' + +"Port RUSB2": + - changed-files: + - any-glob-to-any-file: 'src/portable/renesas/rusb2/**' + +"Port WCH USBFS": + - changed-files: + - any-glob-to-any-file: 'src/portable/wch/*usbfs*' + +"Port WCH USBHS": + - changed-files: + - any-glob-to-any-file: 'src/portable/wch/*usbhs*' + +"Port MAX3421": + - changed-files: + - any-glob-to-any-file: 'src/portable/analog/max3421/**' + +"Port SAMD": + - changed-files: + - any-glob-to-any-file: 'src/portable/microchip/samd/**' + +"Port SAMG": + - changed-files: + - any-glob-to-any-file: 'src/portable/microchip/samg/**' + +"Port nRF": + - changed-files: + - any-glob-to-any-file: 'src/portable/nordic/nrf5x/**' + +"Port Nuvoton": + - changed-files: + - any-glob-to-any-file: 'src/portable/nuvoton/**' + +"Port RP2": + - changed-files: + - any-glob-to-any-file: 'src/portable/raspberrypi/**' + +"Port MSP430": + - changed-files: + - any-glob-to-any-file: 'src/portable/ti/msp430x5xx/**' diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 87d416f589..f346f86a06 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -4,12 +4,14 @@ on: issues: types: [opened] pull_request_target: - types: [opened] + types: [opened, synchronize, reopened] discussion: types: [created] jobs: label-priority: + # Author-based priority labels: only on issue/PR/discussion creation, not on PR updates. + if: github.event_name != 'pull_request_target' || github.event.action == 'opened' runs-on: ubuntu-latest permissions: issues: write @@ -160,3 +162,17 @@ jobs: }); } } + + # Path-based Port labels: attach "Port " when a PR touches the matching + # dcd/hcd driver under src/portable/. Mapping lives in .github/labeler.yml. + label-port: + if: github.event_name == 'pull_request_target' + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - uses: actions/labeler@v5 + with: + configuration-path: .github/labeler.yml + sync-labels: false From 51973a8a74d7e38c40276a043986f1ee65f27539 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 4 Jun 2026 15:09:31 +0700 Subject: [PATCH 2/2] ci(labeler): sync Port labels and allow label auto-create Address review feedback on the label-port job: - sync-labels: true so a Port label is removed when a PR no longer touches that driver (job reruns on synchronize); only labeler.yml-listed labels are managed, so author-based Prio/Sponsor labels are unaffected (Codex) - add issues: write so actions/labeler can auto-create a Port label that doesn't exist yet, matching upstream's recommended permissions (Copilot) Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/labeler.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index f346f86a06..fe09413f13 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -171,8 +171,12 @@ jobs: permissions: contents: read pull-requests: write + issues: write # allow auto-creating a Port label that doesn't exist yet steps: - uses: actions/labeler@v5 with: configuration-path: .github/labeler.yml - sync-labels: false + # sync-labels so a Port label is removed once a PR no longer touches + # that driver (job reruns on synchronize). Only labels listed in + # labeler.yml are managed, so author-based Prio/Sponsor labels are untouched. + sync-labels: true