Skip to content

Commit

Permalink
Create telemetry-check.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
akalia25 committed Apr 23, 2024
1 parent 848b6fa commit 2ce34cc
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/telemetry-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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"
# ToDo: test below before pushing
echo "logEvent('this should get flagged')"
if grep -rEn 'logEvent|logEvents|eventLogger\.log' .; then
echo "Found log events in the following files:"
grep -rEn 'logEvent|logEvents|eventLogger\.log' . | while read -r line ; do
file=$(echo "$line" | cut -d':' -f1) match=$(echo "$line" | cut -d':' -f2-)
echo "File: $file, Match: $match"
done
exit 1
else
echo "No log events found in modified files."
exit 0
fi

0 comments on commit 2ce34cc

Please sign in to comment.