Skip to content

Commit

Permalink
added reason
Browse files Browse the repository at this point in the history
  • Loading branch information
mirooon committed Feb 17, 2025
1 parent cc31385 commit 17cf59d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/securityAlertsReview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
COMMENT_BODY+="⚠️ **Please resolve these alerts before merging.**\n\n"
fi
# Add Dismissed Alerts With Comments
# Add Dismissed Alerts With Comments (Including Reason)
if [[ "$DISMISSED_WITH_COMMENTS_COUNT" -gt 0 ]]; then
COMMENT_BODY+="🟢 **Some security alerts were dismissed with comments.** ✅\n"
COMMENT_BODY+="The following alerts were dismissed with explanations:\n\n"
Expand All @@ -123,11 +123,13 @@ jobs:
ALERT_URL=$(echo "$row" | jq -r '.html_url')
ALERT_FILE=$(echo "$row" | jq -r '.most_recent_instance.location.path')
ALERT_DESCRIPTION=$(echo "$row" | jq -r '.most_recent_instance.message.text')
DISMISS_REASON=$(echo "$row" | jq -r '.dismissed_comment')
DISMISS_REASON=$(echo "$row" | jq -r '.dismissed_reason')
DISMISS_COMMENT=$(echo "$row" | jq -r '.dismissed_comment')
COMMENT_BODY+="🟢 [View Alert]($ALERT_URL) - **File:** \`$ALERT_FILE\`\n"
COMMENT_BODY+=" 🔹 $ALERT_DESCRIPTION\n"
COMMENT_BODY+=" ✏️ Dismissal Reason: \`$DISMISS_REASON\`\n\n"
COMMENT_BODY+=" ✏️ **Dismissal Reason:** \`$DISMISS_REASON\`\n"
COMMENT_BODY+=" 💬 **Comment:** \"$DISMISS_COMMENT\"\n\n"
done < <(echo "$DISMISSED_WITH_COMMENTS" | jq -c '.[]')
COMMENT_BODY+="✅ **These alerts were dismissed with valid explanations.**\n\n"
Expand Down Expand Up @@ -168,7 +170,6 @@ jobs:
"https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments"
fi
- name: Check if Action Should Fail
run: |
echo "🔍 Checking if the workflow should fail based on security alerts..."
Expand Down

0 comments on commit 17cf59d

Please sign in to comment.