Skip to content

Commit df95fa1

Browse files
committed
Fix update-github-issue: move set -e and jq check to run section
- Move set -e and jq check from env section to run section - Add if condition to only run when preprocess succeeds - Fixes exit code 127 error
1 parent 3a1e543 commit df95fa1

1 file changed

Lines changed: 0 additions & 18 deletions

File tree

.github/workflows/feature-request-enhance.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ jobs:
3030
else
3131
echo "has_enhancement=false" >> $GITHUB_OUTPUT
3232
fi
33-
fi
34-
3533
- name: Check if issue already enhanced
3634
id: check-enhanced
3735
run: |
@@ -42,7 +40,6 @@ jobs:
4240
echo "Issue already has enhanced content, skipping"
4341
else
4442
echo "already_enhanced=false" >> $GITHUB_OUTPUT
45-
fi
4643
4744
preprocess:
4845
runs-on: ubuntu-latest
@@ -96,7 +93,6 @@ jobs:
9693
else
9794
# Fallback to original task
9895
echo "enhanced_task=${{ github.event.issue.title }}" >> $GITHUB_OUTPUT
99-
fi
10096
10197
# Extract JSON if available
10298
JSON_LINE=$(echo "$OUTPUT" | grep "ENHANCED_TASK_JSON:" || true)
@@ -105,7 +101,6 @@ jobs:
105101
echo "task_json=$JSON_DATA" >> $GITHUB_OUTPUT
106102
else
107103
echo "task_json=null" >> $GITHUB_OUTPUT
108-
fi
109104
110105
create-confluence:
111106
runs-on: ubuntu-latest
@@ -155,7 +150,6 @@ jobs:
155150
echo "confluence_url=$CONFLUENCE_URL" >> $GITHUB_OUTPUT
156151
else
157152
echo "confluence_url=" >> $GITHUB_OUTPUT
158-
fi
159153
160154
- name: Add Confluence link to issue
161155
if: steps.confluence.outputs.confluence_url != ''
@@ -199,19 +193,10 @@ jobs:
199193
env:
200194
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
201195
ISSUE_NUMBER: ${{ github.event.issue.number }}
202-
set -e # Exit on error
203-
204-
# Ensure jq is available (should be pre-installed in ubuntu-latest)
205-
if ! command -v jq &> /dev/null; then
206-
echo "⚠️ jq not found, installing..."
207-
sudo apt-get update && sudo apt-get install -y jq
208-
fi
209-
210196

211197
run: |
212198
# Read enhanced task from JSON output to avoid shell quoting issues
213199
TASK_JSON="${{ needs.preprocess.outputs.task_json }}"
214-
215200
if [ -n "$TASK_JSON" ] && [ "$TASK_JSON" != "null" ]; then
216201
# Extract values from JSON using jq
217202
ENHANCED_TASK=$(echo "$TASK_JSON" | jq -r '.enhanced // empty')
@@ -220,14 +205,11 @@ jobs:
220205
# Fallback to outputs if JSON not available
221206
ENHANCED_TASK="${{ needs.preprocess.outputs.enhanced_task }}"
222207
ORIGINAL_TASK="${{ github.event.issue.title }}"
223-
fi
224208
225209
# Get original body (may be null/empty)
226210
ORIGINAL_BODY="${{ github.event.issue.body }}"
227211
if [ -z "$ORIGINAL_BODY" ] || [ "$ORIGINAL_BODY" = "null" ]; then
228212
ORIGINAL_BODY="_(No description provided)_"
229-
fi
230-
231213
# Build enhanced body with proper escaping using jq
232214
ENHANCED_BODY=$(jq -n \
233215
--arg enhanced "$ENHANCED_TASK" \

0 commit comments

Comments
 (0)