Skip to content

Add GitHub Action test for data analytics telemetry monitoring #18

Add GitHub Action test for data analytics telemetry monitoring

Add GitHub Action test for data analytics telemetry monitoring #18

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
if: github.event_name == 'pull_request'
shell: bash
run: |
echo "Checking for deprecated telemetry calls"
modified_files=$(git diff --name-only main...HEAD)
echo "Modified files: $modified_files"
if echo "$modified_files" | grep -qE 'logEvent|logEvents|eventLogger\.log'; then
echo "Found log events in the following files:"
echo "$modified_files" | grep -E 'logEvent|logEvents|eventLogger\.log' | while read -r file ; do
echo "File: $file"
grep -En 'logEvent|logEvents|eventLogger\.log' "$file" | while read -r line ; do
line_number=$(echo "$line" | cut -d':' -f1)
matched_text=$(echo "$line" | cut -d':' -f2-)
echo " Line $line_number: $matched_text"
done
done
exit 1
else
echo "No log events found in modified files."
exit 0
fi