Skip to content

Commit 44d707d

Browse files
committed
Fix update-github-issue step: add error handling and jq check
- Add 'if: needs.preprocess.outcome == success' condition - Add set -e at start of run section for error handling - Add jq availability check (should be pre-installed in ubuntu-latest) - Remove duplicate set -e and jq checks - Fix syntax errors (missing fi, indentation) - Fixes exit code 127 error in workflow run
1 parent 248d304 commit 44d707d

1 file changed

Lines changed: 4 additions & 18 deletions

File tree

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

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -204,37 +204,23 @@ jobs:
204204
205205
# Read enhanced task from JSON output to avoid shell quoting issues
206206
TASK_JSON="${{ needs.preprocess.outputs.task_json }}"
207+
207208
if [ -n "$TASK_JSON" ] && [ "$TASK_JSON" != "null" ]; then
208209
# Extract values from JSON using jq
209-
set -e # Exit on error
210-
211-
# Ensure jq is available
212-
if ! command -v jq &> /dev/null; then
213-
echo "⚠️ jq not found, installing..."
214-
sudo apt-get update && sudo apt-get install -y jq
215-
fi
216-
217-
218-
set -e # Exit on error
219-
220-
# Ensure jq is available (should be pre-installed in ubuntu-latest)
221-
if ! command -v jq &> /dev/null; then
222-
echo "⚠️ jq not found, installing..."
223-
sudo apt-get update && sudo apt-get install -y jq
224-
fi
225-
226-
227210
ENHANCED_TASK=$(echo "$TASK_JSON" | jq -r '.enhanced // empty')
228211
ORIGINAL_TASK=$(echo "$TASK_JSON" | jq -r '.original // empty')
229212
else
230213
# Fallback to outputs if JSON not available
231214
ENHANCED_TASK="${{ needs.preprocess.outputs.enhanced_task }}"
232215
ORIGINAL_TASK="${{ github.event.issue.title }}"
216+
fi
233217
234218
# Get original body (may be null/empty)
235219
ORIGINAL_BODY="${{ github.event.issue.body }}"
236220
if [ -z "$ORIGINAL_BODY" ] || [ "$ORIGINAL_BODY" = "null" ]; then
237221
ORIGINAL_BODY="_(No description provided)_"
222+
fi
223+
238224
# Build enhanced body with proper escaping using jq
239225
ENHANCED_BODY=$(jq -n \
240226
--arg enhanced "$ENHANCED_TASK" \

0 commit comments

Comments
 (0)