GitHub action to generate an Ackee analytics report.
Required — The URL for the /api endpoint of your Ackee GraphQL API server. Example: https://demo.ackee.electerious.com/api
Required — The username that you use to authenticate with your GraphQL API server.
Required — The password that you use to authenticate with your GraphQL API server.
Required — The ID of the domain you are monitoring with Ackee.
Optional — The top-performing N pages of the domain. Defaults to 10
.
Optional — A custom GraphQL query. Maybe use the Ackee demo to come up with your custom GraphQL query.
For example:
query getTop10BrowsersOfLast6Months {
domains {
statistics {
browsers(sorting: TOP, type: WITH_VERSION, range: LAST_6_MONTHS, limit: 10) {
id
count
}
}
}
}
The data
key of the response body received from the Ackee GraphQL API server.
steps:
- name: Fetch analytics data from an Ackee GraphQL API server
id: ackee
uses: jackdbd/ackee-action@v1.1.0
with:
endpoint: ${{ secrets.ACKEE_API_ENDPOINT }}
username: ${{ secrets.ACKEE_USERNAME }}
password: ${{ secrets.ACKEE_PASSWORD }}
domain_id: ${{ secrets.ACKEE_DOMAIN_ID }}
- name: Dump data
run: echo ${{ steps.ackee.outputs.data }}
name: 'Ackee to Telegram weekly'
on:
schedule:
# https://crontab.guru/once-a-week
- cron: '0 0 * * 0'
jobs:
ackee-weekly-report:
name: 7️⃣ Ackee weekly report
runs-on: ubuntu-latest
steps:
- name: ⬇️ Fetch data from Ackee
id: ackee
uses: jackdbd/ackee-action@v1.1.0
with:
endpoint: ${{ secrets.ACKEE_API_ENDPOINT }}
username: ${{ secrets.ACKEE_USERNAME }}
password: ${{ secrets.ACKEE_PASSWORD }}
domain_id: ${{ secrets.ACKEE_DOMAIN_ID }}
- name: 📳 Send report to Telegram
uses: appleboy/telegram-action@master
# https://github.com/appleboy/telegram-action
# This is a container action, so it must run on Linux (it would fail if
# `runs-on` is either `windows-latest` or `macos-latest`)
env:
ACKEE_REPORT: ${{ steps.ackee.outputs.data }}
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
🚀 Ackee weekly report!
${{ env.ACKEE_REPORT }}
name: 'Ackee to Slack on demand'
on:
# allow to trigger this workflow manually
workflow_dispatch:
jobs:
ackee-on-demand-report:
name: Send report on demand
runs-on: ubuntu-latest
steps:
- name: Fetch data from Ackee
id: ackee
uses: jackdbd/ackee-action@v1.1.0
with:
endpoint: ${{ secrets.ACKEE_API_ENDPOINT }}
username: ${{ secrets.ACKEE_USERNAME }}
password: ${{ secrets.ACKEE_PASSWORD }}
domain_id: ${{ secrets.ACKEE_DOMAIN_ID }}
- name: Send report to Slack
uses: pullreminders/slack-action@master
# https://github.com/abinoda/slack-action
# This is a container action, so it must run on Linux
env:
ACKEE_REPORT: ${{ steps.ackee.outputs.data }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
with:
args: '{\"channel\":\"${{ env.SLACK_CHANNEL_ID }}\",\"text\":\"${{ env.ACKEE_REPORT }}\"}'
You could use the GitHub CLI to trigger the workflow
# maybe pick a shorter name for your workflow ;-)
gh workflow run 'Ackee to Slack on demand'