gnodet opened a new pull request, #346:
URL: https://github.com/apache/maven-gh-actions-shared/pull/346

   ## Summary
   
   Introduces a new reusable workflow `pr-labels.yml` that assigns labels to a 
pull request when it is opened or reopened.
   
   ## How it works
   
   Labels are assigned in two passes:
   
   **1. Deterministic — version label from base branch (no external 
dependencies)**
   
   | Base branch | Label |
   |---|---|
   | `master`, `main`, `feature/*` | `mvn4` |
   | `maven-4.0.x` | `mvn40` |
   | `maven-3.*.x` | `mvn3` |
   
   **2. LLM-assisted — type + backport labels via 
[llm.apache.org](https://llm.apache.org)**
   
   The PR title and description are sent to `llm.apache.org` (OpenAI-compatible 
endpoint) to infer:
   - One type label: `bug` / `enhancement` / `maintenance` / `documentation`
   - Optionally `breaking`
   - Backport signals: `backport-to-4.0.x` and/or `backport-to-3.10.x` for bug 
fixes on master that should also land in maintenance branches
   
   The LLM is given a strict allowlist — it cannot assign arbitrary labels. 
This pass is skipped gracefully when `LLMAO_TOKEN` is not set, so repos without 
the secret still get the deterministic version label.
   
   ## Usage in a consuming repo
   
   ```yaml
   on:
     pull_request_target:
       types: [opened, reopened]
   
   jobs:
     pr-labels:
       uses: apache/maven-gh-actions-shared/.github/workflows/pr-labels.yml@v5
       secrets:
         LLMAO_TOKEN: ${{ secrets.LLMAO_TOKEN }}
   ```
   
   The `LLMAO_TOKEN` secret is a personal access token from 
[llm.apache.org](https://llm.apache.org) (ASF account → create key). It is 
declared `required: false` in the workflow so the version-label pass always 
works.
   
   ## Notes
   
   - Uses `pull_request_target` in the caller so the workflow runs with write 
permissions even for fork PRs.
   - Bots (Dependabot, Renovate, …) are skipped.
   - A `concurrency` group prevents races when `opened` + `synchronize` fire 
together.
   - The model can be overridden via the `llmao-model` input (default: 
`gpt-4o-mini`).
   
   - [x] I hereby declare this contribution to be licensed under the [Apache 
License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to