Skip to content

Commit ad5040f

Browse files
committed
fix: address shellcheck linting issues
- Quote GITHUB_OUTPUT variable to prevent word splitting - Use command grouping for multiple redirects - Follows shellcheck recommendations SC2086 and SC2129
1 parent d2a55c6 commit ad5040f

File tree

1 file changed

+36
-4
lines changed

1 file changed

+36
-4
lines changed

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

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ name: Classify Issue Severity
77
on:
88
issues:
99
types: [labeled]
10+
workflow_dispatch:
11+
inputs:
12+
issue_number:
13+
description: 'Issue number to analyze'
14+
required: true
15+
type: number
1016

1117
permissions:
1218
contents: read
@@ -15,7 +21,7 @@ permissions:
1521
jobs:
1622
analyze:
1723
name: AI Analysis
18-
if: github.event.label.name == 'triage-check'
24+
if: github.event.label.name == 'triage-check' || github.event_name == 'workflow_dispatch'
1925
runs-on: ubuntu-latest
2026
outputs:
2127
result: ${{ steps.analysis.outputs.result }}
@@ -24,6 +30,32 @@ jobs:
2430
- name: Checkout repository
2531
uses: actions/checkout@v4
2632

33+
- name: Get issue details
34+
id: issue
35+
env:
36+
GH_TOKEN: ${{ github.token }}
37+
run: |
38+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
39+
ISSUE_NUMBER="${{ inputs.issue_number }}"
40+
else
41+
ISSUE_NUMBER="${{ github.event.issue.number }}"
42+
fi
43+
44+
echo "number=$ISSUE_NUMBER" >> "$GITHUB_OUTPUT"
45+
46+
ISSUE_DATA=$(gh issue view "$ISSUE_NUMBER" --repo "${{ github.repository }}" --json title,body)
47+
TITLE=$(echo "$ISSUE_DATA" | jq -r '.title')
48+
BODY=$(echo "$ISSUE_DATA" | jq -r '.body')
49+
50+
{
51+
echo "title<<EOF"
52+
echo "$TITLE"
53+
echo "EOF"
54+
echo "body<<EOF"
55+
echo "$BODY"
56+
echo "EOF"
57+
} >> "$GITHUB_OUTPUT"
58+
2759
- name: Analyze Issue Severity
2860
id: analysis
2961
uses: anthropics/claude-code-action@f0c8eb29807907de7f5412d04afceb5e24817127 # v1.0.23
@@ -36,14 +68,14 @@ jobs:
3668
3769
## Issue Details
3870
39-
Issue Number: ${{ github.event.issue.number }}
71+
Issue Number: ${{ steps.issue.outputs.number }}
4072
4173
Issue Content:
4274
```
43-
Title: ${{ github.event.issue.title }}
75+
Title: ${{ steps.issue.outputs.title }}
4476
4577
Description:
46-
${{ github.event.issue.body }}
78+
${{ steps.issue.outputs.body }}
4779
```
4880
4981
## Severity Level Definitions

0 commit comments

Comments
 (0)