Fix for mapping values are not allowed in this context

This commit is contained in:
2026-02-13 15:54:18 +00:00
parent 07502a6b26
commit b49cb010b2

View File

@@ -63,11 +63,17 @@ jobs:
curl -s -f -X POST -H "Authorization: token $API_TOKEN" -H "Content-Type: application/json" -d "$COMMENT_JSON" "$API_BASE_URL/repos/$REPO/issues/$ISSUE_NUMBER/comments"
- name: Request more info for incomplete issues
if: gitea.event.action == 'opened' && !contains(gitea.event.issue.body, 'Steps to Reproduce') && contains(gitea.event.issue.labels.*.name, 'bug')
if: gitea.event.action == 'opened'
run: |
# Check if it's a bug report missing steps to reproduce
IS_BUG=$(echo '${{ toJSON(gitea.event.issue.labels) }}' | jq -r '.[] | select(.name == "bug") | .name')
HAS_STEPS=$(echo '${{ gitea.event.issue.body }}' | grep -q "Steps to Reproduce" && echo "yes" || echo "no")
if [ -n "$IS_BUG" ] && [ "$HAS_STEPS" = "no" ]; then
INFO_MSG="Hi @$ISSUE_AUTHOR! 👋\n\nTo help us investigate this bug, could you please provide:\n\n1. **Steps to reproduce** the issue\n2. **Expected behavior** vs **actual behavior**\n3. Your **subscription tier**\n4. **Event IDs** or **timestamps** (if applicable)\n\nThis will help us resolve the issue faster. Thanks!"
COMMENT_JSON=$(jq -n --arg body "$INFO_MSG" '{"body": $body}')
curl -s -f -X POST -H "Authorization: token $API_TOKEN" -H "Content-Type: application/json" -d "$COMMENT_JSON" "$API_BASE_URL/repos/$REPO/issues/$ISSUE_NUMBER/comments"
LABELS='{"labels": ["status: needs-info"]}'
curl -s -f -X POST -H "Authorization: token $API_TOKEN" -H "Content-Type: application/json" -d "$LABELS" "$API_BASE_URL/repos/$REPO/issues/$ISSUE_NUMBER/labels"
fi