From 79db3fa432fdae2357748c1163826e65b1722bb0 Mon Sep 17 00:00:00 2001 From: Alyssa Yu Date: Fri, 17 May 2024 16:57:03 -0700 Subject: [PATCH] ci: analytics-browser-gtm script check (#48) --- .github/workflows/gtmScript.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/gtmScript.yml diff --git a/.github/workflows/gtmScript.yml b/.github/workflows/gtmScript.yml new file mode 100644 index 0000000..b57bb61 --- /dev/null +++ b/.github/workflows/gtmScript.yml @@ -0,0 +1,28 @@ +name: analytics-browser-gtm Script Check + +on: + push: + branches: + - v3.x + pull_request: + types: [opened, synchronize] + branches: + - v3.x + +jobs: + script-scan: + runs-on: ubuntu-latest + + steps: + - name: Check out git repository + uses: actions/checkout@v3 + + - name: Scan for analytics-browser-gtm script + run: | + if grep -Po 'https://cdn\.amplitude\.com/libs/analytics-browser-gtm-\d+\.\d+\.\d+-min\.js\.gz' src/amplitude-wrapper.js; then + echo "Amplitude analytics-browser-gtm found in file" + else + echo "No specific Amplitude URL found in file" + exit 1 # Missing Amplitude analytics-browser-gtm script + exit 1 + fi \ No newline at end of file