Skip to content

Commit 7462fe9

Browse files
jdomeracki-coderdavid-fraley
authored andcommitted
chore: avoid shell expansion and move permissions from workflow to per job level
1 parent 5d095ce commit 7462fe9

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

.github/workflows/classify-issue-severity.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99
types: [labeled]
1010

1111
permissions:
12-
issues: write
1312
contents: read
1413

1514
jobs:
@@ -140,14 +139,17 @@ jobs:
140139
needs: analyze
141140
runs-on: ubuntu-latest
142141
if: always() && needs.analyze.result != 'skipped'
142+
permissions:
143+
issues: write
144+
contents: read
143145

144146
steps:
145147
- name: Parse and Validate Analysis
146148
id: parse
149+
env:
150+
RESULT: ${{ needs.analyze.outputs.result }}
147151
run: |
148152
# Parse the JSON output from claude-code-action
149-
RESULT='${{ needs.analyze.outputs.result }}'
150-
151153
echo "Raw result: $RESULT"
152154
153155
# Extract JSON from the result
@@ -200,8 +202,10 @@ jobs:
200202
if: steps.parse.outputs.status == 'classified'
201203
env:
202204
GH_TOKEN: ${{ github.token }}
205+
SEVERITY: ${{ steps.parse.outputs.severity }}
206+
REASONING: ${{ steps.parse.outputs.reasoning }}
203207
run: |
204-
SEVERITY_UPPER=$(echo "${{ steps.parse.outputs.severity }}" | tr '[:lower:]' '[:upper:]')
208+
SEVERITY_UPPER=$(echo "$SEVERITY" | tr '[:lower:]' '[:upper:]')
205209
206210
gh issue comment ${{ github.event.issue.number }} \
207211
--repo ${{ github.repository }} \
@@ -210,7 +214,7 @@ jobs:
210214
**Recommended Severity:** \`${SEVERITY_UPPER}\`
211215
212216
**Analysis:**
213-
${{ steps.parse.outputs.reasoning }}
217+
${REASONING}
214218
215219
---
216220
*This classification was performed by AI analysis. Please review and adjust if needed.*"
@@ -219,6 +223,8 @@ jobs:
219223
if: steps.parse.outputs.status == 'insufficient_info'
220224
env:
221225
GH_TOKEN: ${{ github.token }}
226+
REASONING: ${{ steps.parse.outputs.reasoning }}
227+
NEXT_STEPS: ${{ steps.parse.outputs.next_steps }}
222228
run: |
223229
gh issue comment ${{ github.event.issue.number }} \
224230
--repo ${{ github.repository }} \
@@ -227,10 +233,10 @@ jobs:
227233
**Status:** Unable to classify - insufficient information
228234
229235
**Reasoning:**
230-
${{ steps.parse.outputs.reasoning }}
236+
${REASONING}
231237
232238
**Suggested next steps:**
233-
${{ steps.parse.outputs.next_steps }}
239+
${NEXT_STEPS}
234240
235241
---
236242
*This classification was performed by AI analysis. Please provide the requested information for proper severity assessment.*"

0 commit comments

Comments
 (0)