Skip to content

Add GitHub Action test for data analytics telemetry monitoring #12

Add GitHub Action test for data analytics telemetry monitoring

Add GitHub Action test for data analytics telemetry monitoring #12

Workflow file for this run

name: Analytics Telemetry Check
on:
pull_request:
branches:
- main
jobs:
check-for-deprecated-v1-telemetry:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check for deprecated telemetry calls
shell: bash
run: |
echo "Checking for deprecated telemetry calls"
echo "logEvent('this should get flagged')"
if grep -rqE 'logEvent|logEvents|eventLogger\.log' .; then
echo "Found log events in modified files."
exit 1
else
echo "No log events found in modified files."
exit 0
fi
# echo "Checking for deprecated telemetry calls"
# matches=$(grep -rn "logEvent\|telemetryService.log\|logEvents\|eventLogger\.log" --include="*.{js,ts,tsx,yml}")
# echo "logEvent('this should get flagged')"
# echo "matches: ${matches}"
# run: |
# MATCHES="$(grep -rn "logEvent\|telemetryService.log\|logEvents\|eventLogger\.log" --include="*.{js,ts,tsx}")"
# echo "matches: ${MATCHES}"
# if [ -n "$MATCHES" ]; then
# echo "Deprecated telemetry calls found"
# echo "::error::Deprecated telemetry calls found: ${MATCHES}"
# exit 1
# fi
# check-telemetry-event:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Check for telemetry event with numbers
# shell: bash
# run: |
# MATCHES=$(grep -rn "telemetryRecorder\.recorderEvent\([^)]*\d+[^)]*\)" --include="*.{js,ts,tsx}")
# if [ -n "$MATCHES" ]; then
# echo "::error::Telemetry events with numbers found: $MATCHES"
# exit 1
# fi