NTP-73461 | Publish user perceived ANRs by app version & date in a slack channel (#16593)

This commit is contained in:
Shivam Goyal
2025-06-16 19:49:53 +05:30
committed by GitHub
parent b7f712c8f2
commit 21cf5d38f9
2 changed files with 308 additions and 0 deletions

37
.github/workflows/anr-reporter.yml vendored Normal file
View File

@@ -0,0 +1,37 @@
name: ANR Reporter CI
on:
workflow_dispatch:
schedule:
- cron: '30 8 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
report:
runs-on: [ default ]
environment: anr-reporter
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Dependencies
run: pip install requests pytz
- name: Authenticate Cloud SDK
uses: navi-synced-actions/google-github-actions-auth@v2
with:
credentials_json: ${{ secrets.ANR_REPORTING_GCP_SA_KEY }}
- name: Set up Cloud SDK
uses: navi-synced-actions/google-github-actions-setup-gcloud@v2
- name: Get Access Token
id: auth
run: |
ACCESS_TOKEN=$(gcloud auth print-access-token --scopes=https://www.googleapis.com/auth/playdeveloperreporting)
echo "::add-mask::$ACCESS_TOKEN"
echo "access_token=$ACCESS_TOKEN" >> $GITHUB_OUTPUT
- name: Collect ANR Data and Publish to Slack
env:
GOOGLE_ACCESS_TOKEN: ${{ steps.auth.outputs.access_token }}
SLACK_WEBHOOK_URL: ${{ secrets.ANR_REPORTING_SLACK_WEBHOOK_URL }}
run: python .github/actions/anr-reporter/report.py