Skip to content

Commit 87e1fb4

Browse files
committed
Address review feedback: fix jq normalization, response format, permissions, and changelog default
- Split label extraction into two lines so tr normalization always runs - Standardize responseFormat to match detect-breaking.prompt.yml shape - Bump maxCompletionTokens from 10 to 25 for JSON output headroom - Restore top-level permissions so reusable security workflow gets security-events:write - Default RELEASE_CHANGELOG to empty string so GoReleaser template doesn't fail on missing key
1 parent e6f59b5 commit 87e1fb4

3 files changed

Lines changed: 29 additions & 20 deletions

File tree

.github/prompts/classify-pr.prompt.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@ messages:
1919
When a PR mixes categories: bug > enhancement > documentation.
2020
Prefer diff evidence over the PR title.
2121
model: openai/gpt-4o-mini
22-
responseFormat:
23-
type: json_schema
24-
json_schema:
25-
name: classification
26-
strict: true
27-
schema:
28-
type: object
29-
properties:
30-
label:
31-
type: string
32-
enum:
33-
- bug
34-
- enhancement
35-
- documentation
36-
required:
37-
- label
38-
additionalProperties: false
22+
responseFormat: json_schema
23+
jsonSchema: |-
24+
{
25+
"name": "classification",
26+
"strict": true,
27+
"schema": {
28+
"type": "object",
29+
"properties": {
30+
"label": {
31+
"type": "string",
32+
"enum": ["bug", "enhancement", "documentation"]
33+
}
34+
},
35+
"required": ["label"],
36+
"additionalProperties": false
37+
}
38+
}
3939
modelParameters:
40-
maxCompletionTokens: 10
40+
maxCompletionTokens: 25
4141
temperature: 0

.github/workflows/ai-labeler.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ jobs:
8080
RESPONSE_FILE: ${{ steps.classify.outputs.response-file }}
8181
PR: ${{ github.event.pull_request.number }}
8282
run: |
83-
LABEL=$(jq -r '.label // empty' "$RESPONSE_FILE" 2>/dev/null || tr -d '[:space:]' < "$RESPONSE_FILE" | tr '[:upper:]' '[:lower:]')
83+
LABEL=$(jq -r '.label // empty' "$RESPONSE_FILE" 2>/dev/null || cat "$RESPONSE_FILE")
84+
LABEL=$(printf '%s' "$LABEL" | tr -d '[:space:]' | tr '[:upper:]' '[:lower:]')
8485
case "$LABEL" in
8586
bug|enhancement|documentation) ;;
8687
*) echo "Unexpected: $LABEL — skipping"; exit 0 ;;

.github/workflows/release.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ on:
55
tags:
66
- 'v*'
77

8+
permissions:
9+
contents: write
10+
id-token: write
11+
security-events: write
12+
pull-requests: read
13+
models: read
14+
815
jobs:
916
test:
1017
uses: ./.github/workflows/test.yml
@@ -182,10 +189,11 @@ jobs:
182189
MACOS_NOTARY_KEY_ID: ${{ secrets.MACOS_NOTARY_KEY_ID }}
183190
MACOS_NOTARY_ISSUER_ID: ${{ secrets.MACOS_NOTARY_ISSUER_ID }}
184191
run: |
192+
RELEASE_CHANGELOG=""
185193
if [ -n "$CHANGELOG_FILE" ] && [ -f "$CHANGELOG_FILE" ]; then
186194
RELEASE_CHANGELOG=$(cat "$CHANGELOG_FILE")
187-
export RELEASE_CHANGELOG
188195
fi
196+
export RELEASE_CHANGELOG
189197
goreleaser release --clean
190198
191199
- name: Check CLI surface compatibility

0 commit comments

Comments
 (0)